C# Class Castle.MonoRail.Framework.Services.DefaultControllerTree

Default implementation of IControllerTree. Represents an binary tree of registered controllers.

It is used by the controller factory to resolve a controller instance based on the specified area (which is optional) and controller name

IControllerTree Castle.MonoRail.Framework.Services.AbstractControllerFactory
Inheritance: IControllerTree
Show file Open project: nats/castle-1.0.3-mono Class Usage Examples

Public Methods

Method Description
AddController ( String areaName, String controllerName, Type controller ) : void

Register a controller on the tree. If the specified area name matches the current node, the controller is register on the node itself, otherwise on the right or on the left node.

Note that the controller is an object. That allows different implementation of a controller factory to register different representation of what a controller is (a name, a descriptor etc)

DefaultControllerTree ( ) : System

Constructs a ControllerTree with an empty area

DefaultControllerTree ( String areaName ) : System

Constructs a ControllerTree specifying an area

GetController ( String areaName, String controllerName ) : Type

Returns a controller previously registered.

Method Details

AddController() public method

Register a controller on the tree. If the specified area name matches the current node, the controller is register on the node itself, otherwise on the right or on the left node.
Note that the controller is an object. That allows different implementation of a controller factory to register different representation of what a controller is (a name, a descriptor etc)
public AddController ( String areaName, String controllerName, Type controller ) : void
areaName String The area name, or String.Empty
controllerName String The controller name
controller System.Type The controller representation
return void

DefaultControllerTree() public method

Constructs a ControllerTree with an empty area
public DefaultControllerTree ( ) : System
return System

DefaultControllerTree() public method

Constructs a ControllerTree specifying an area
public DefaultControllerTree ( String areaName ) : System
areaName String
return System

GetController() public method

Returns a controller previously registered.
public GetController ( String areaName, String controllerName ) : Type
areaName String The area name, or String.Empty
controllerName String The controller name
return System.Type