More working tests.
[castle.git] / MonoRail / Castle.MonoRail.Framework / IViewSourceLoader.cs
blob5613c04c36bcd787ac6be7f3ee5f2a43997631fb
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework
17 using System;
18 using System.Collections;
19 using System.IO;
21 /// <summary>
22 /// Defines a contract that abstracts view template locations.
23 /// </summary>
24 public interface IViewSourceLoader
26 /// <summary>
27 /// Evaluates whether the specified template exists.
28 /// </summary>
29 /// <param name="sourceName">The template name</param>
30 /// <returns><c>true</c> if it exists</returns>
31 bool HasSource(String sourceName);
33 /// <summary>
34 /// Builds and returns a representation of a view template
35 /// </summary>
36 /// <param name="templateName">The template name</param>
37 /// <returns></returns>
38 IViewSource GetViewSource(String templateName);
40 /// <summary>
41 /// Gets a list of views on the specified directory
42 /// </summary>
43 /// <param name="dirName">Directory name</param>
44 /// <returns></returns>
45 /// <param name="fileExtensionsToInclude">Optional fileExtensions to include in listing.</param>
46 String[] ListViews(String dirName, params string[] fileExtensionsToInclude);
48 /// <summary>
49 /// Gets/sets the root directory of views, obtained from the configuration.
50 /// </summary>
51 string VirtualViewDir { get; set; }
53 /// <summary>
54 /// Gets/sets the root directory of views, obtained from the configuration.
55 /// </summary>
56 string ViewRootDir { get; set; }
58 /// <summary>
59 /// Gets or sets whether the instance should use cache
60 /// </summary>
61 bool EnableCache { get; set; }
63 /// <summary>
64 /// Gets a list of assembly sources
65 /// </summary>
66 IList AssemblySources { get; }
68 /// <summary>
69 /// Adds the assembly source.
70 /// </summary>
71 /// <param name="assemblySourceInfo">The assembly source info.</param>
72 void AddAssemblySource(AssemblySourceInfo assemblySourceInfo);
74 /// <summary>
75 /// Raised when the view is changed.
76 /// </summary>
77 event FileSystemEventHandler ViewChanged;