Fixing 21 PEVerify tests.
[castle.git] / MonoRail / Castle.MonoRail.Framework / IControllerTree.cs
blob66a7669bffb362f3df03e0d4955310d34a6cbc7a
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;
19 /// <summary>
20 /// Represents an binary tree of registered controllers.
21 /// <para>
22 /// It is used by the controller factory to resolve a controller instance
23 /// based on the specified area (which is optional) and controller name
24 /// </para>
25 /// <seealso cref="Castle.MonoRail.Framework.Services.AbstractControllerFactory"/>
26 /// </summary>
27 public interface IControllerTree
29 /// <summary>
30 /// Register a controller on the tree. If the specified
31 /// area name matches the current node, the controller is
32 /// register on the node itself, otherwise on the right or
33 /// on the left node.
34 /// </summary>
35 /// <remarks>
36 /// Note that the controller is an <c>object</c>. That allows
37 /// different implementation of a controller factory to register
38 /// different representation of what a controller is (a name, a descriptor etc)
39 /// </remarks>
40 /// <param name="areaName">The area name, or <c>String.Empty</c></param>
41 /// <param name="controllerName">The controller name</param>
42 /// <param name="controller">The controller representation</param>
43 void AddController(String areaName, String controllerName, Type controller);
45 /// <summary>
46 /// Returns a controller previously registered.
47 /// </summary>
48 /// <param name="areaName">The area name, or <c>String.Empty</c></param>
49 /// <param name="controllerName">The controller name</param>
50 /// <returns>The controller representation or null</returns>
51 Type GetController(String areaName, String controllerName);