Minor changes to improve testability of helpers
[castle.git] / MonoRail / Castle.MonoRail.Framework / IViewSourceLoader.cs
blob711c2058ad3ea4d0aa49a1cbc05599f1a18d696c
1 // Copyright 2004-2007 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="templateName">The template name</param>
30 /// <returns><c>true</c> if it exists</returns>
31 bool HasTemplate(String templateName);
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 String[] ListViews(String dirName);
47 /// <summary>
48 /// Gets/sets the root directory of views, obtained from the configuration.
49 /// </summary>
50 String ViewRootDir { get; set; }
52 /// <summary>
53 /// Gets or sets whether the instance should use cache
54 /// </summary>
55 bool EnableCache { get; set; }
57 /// <summary>
58 /// Gets a list of assembly sources
59 /// </summary>
60 IList AssemblySources { get; }
62 /// <summary>
63 /// Adds the assembly source.
64 /// </summary>
65 /// <param name="assemblySourceInfo">The assembly source info.</param>
66 void AddAssemblySource(AssemblySourceInfo assemblySourceInfo);
68 /// <summary>
69 /// Raised when the view is changed.
70 /// </summary>
71 event FileSystemEventHandler ViewChanged;