1 // Copyright 2004-2007 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="templateName">The template name</param>
30 /// <returns><c>true</c> if it exists</returns>
31 bool HasTemplate(String templateName
);
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 ViewRootDir { get; set; }
53 /// Gets or sets whether the instance should use cache
55 bool EnableCache { get; set; }
58 /// Gets a list of assembly sources
60 IList AssemblySources { get; }
63 /// Adds the assembly source.
65 /// <param name="assemblySourceInfo">The assembly source info.</param>
66 void AddAssemblySource(AssemblySourceInfo assemblySourceInfo
);
69 /// Raised when the view is changed.
71 event FileSystemEventHandler ViewChanged
;