1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
18 using System
.Collections
;
22 /// Defines a contract that abstracts view template locations.
24 public interface IViewSourceLoader
27 /// Evaluates whether the specified template exists.
29 /// <param name="sourceName">The template name</param>
30 /// <returns><c>true</c> if it exists</returns>
31 bool HasSource(String sourceName
);
34 /// Builds and returns a representation of a view template
36 /// <param name="templateName">The template name</param>
37 /// <returns></returns>
38 IViewSource
GetViewSource(String templateName
);
41 /// Gets a list of views on the specified directory
43 /// <param name="dirName">Directory name</param>
44 /// <returns></returns>
45 String
[] ListViews(String dirName
);
48 /// Gets/sets the root directory of views, obtained from the configuration.
50 string VirtualViewDir { get; set; }
53 /// Gets/sets the root directory of views, obtained from the configuration.
55 string ViewRootDir { get; set; }
58 /// Gets or sets whether the instance should use cache
60 bool EnableCache { get; set; }
63 /// Gets a list of assembly sources
65 IList AssemblySources { get; }
68 /// Adds the assembly source.
70 /// <param name="assemblySourceInfo">The assembly source info.</param>
71 void AddAssemblySource(AssemblySourceInfo assemblySourceInfo
);
74 /// Raised when the view is changed.
76 event FileSystemEventHandler ViewChanged
;