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
22 /// Represents an binary tree of registered controllers.
24 /// It is used by the controller factory to resolve a controller instance
25 /// based on the specified area (which is optional) and controller name
27 /// <seealso cref="Castle.MonoRail.Framework.Services.AbstractControllerFactory"/>
29 public interface IControllerTree
32 /// Register a controller on the tree. If the specified
33 /// area name matches the current node, the controller is
34 /// register on the node itself, otherwise on the right or
38 /// Note that the controller is an <c>object</c>. That allows
39 /// different implementation of a controller factory to register
40 /// different representation of what a controller is (a name, a descriptor etc)
42 /// <param name="areaName">The area name, or <c>String.Empty</c></param>
43 /// <param name="controllerName">The controller name</param>
44 /// <param name="controller">The controller representation</param>
45 void AddController(String areaName
, String controllerName
, Type controller
);
48 /// Returns a controller previously registered.
50 /// <param name="areaName">The area name, or <c>String.Empty</c></param>
51 /// <param name="controllerName">The controller name</param>
52 /// <returns>The controller representation or null</returns>
53 Type
GetController(String areaName
, String controllerName
);
56 /// Occurs when a controller is added to the controller tree.
58 event EventHandler
<ControllerAddedEventArgs
> ControllerAdded
;