Minor style changes
[castle.git] / MonoRail / Castle.MonoRail.Framework / IControllerTree.cs
blob4aeea6223d1eed38d666a03c4b4a90fb802ded5c
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 using Services;
21 /// <summary>
22 /// Represents an binary tree of registered controllers.
23 /// <para>
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
26 /// </para>
27 /// <seealso cref="Castle.MonoRail.Framework.Services.AbstractControllerFactory"/>
28 /// </summary>
29 public interface IControllerTree
31 /// <summary>
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
35 /// on the left node.
36 /// </summary>
37 /// <remarks>
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)
41 /// </remarks>
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);
47 /// <summary>
48 /// Returns a controller previously registered.
49 /// </summary>
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);
55 /// <summary>
56 /// Occurs when a controller is added to the controller tree.
57 /// </summary>
58 event EventHandler<ControllerAddedEventArgs> ControllerAdded;