Table of contents
- 1 Constructors
- 2 Properties
- 3 Methods
- 3.1 BuildMethodArguments(ParameterInfo[] parameters, IRequest request, Object[] actionArgs)
: Object[]
- 3.2 GetRequestParameterName(ParameterInfo param)
: String
- 3.3 SelectBestCandidate(MethodInfo[] candidates, NameValueCollection webParams, Object[] actionArgs)
: MethodInfo
- 3.4 PostSendView(Object view)
- 3.5 PreSendView(Object view)
- 3.6 Initialize()
- 3.7 GetRescueFor(IList rescues, Type exceptionType)
: RescueDescriptor
- 3.8 PerformRescue(MethodInfo method, Exception ex)
: Boolean
- 3.9 ObtainDefaultLayoutName()
: String
- 3.10 ReleaseResources()
- 3.11 CreateResources(MethodInfo method)
- 3.12 InvokeMethod(MethodInfo method, IRequest request, Object[] actionArgs)
- 3.13 SelectMethod(String action, IDictionary actions, IRequest request, Object[] actionArgs)
: MethodInfo
- 3.14 CreateAndInitializeHelpers()
- 3.15 InternalSend(String action, Object[] actionArgs)
- 3.16 Redirect(String url, IDictionary parameters)
- 3.17 Redirect(String url)
- 3.18 CalculatePoints(MethodInfo candidate, NameValueCollection webParams, Object[] actionArgs)
: Int32
- 3.19 BindObject(Type targetType, String prefix)
: Object
- 3.20 BindObject(ParamStore from, Type targetType, String prefix)
: Object
- 3.21 BindObject(ParamStore from, Type targetType, String prefix, String excludedProperties, String allowedProperties)
: Object
- 3.22 BindObjectInstance(Object instance, String prefix)
- 3.23 BindObjectInstance(Object instance, ParamStore from, String prefix)
- 3.24 GetDataBindErrors(Object instance)
: ErrorList
- 3.25 ObtainParamsNode(ParamStore from)
: CompositeNode
- 3.26 RenderView(String name)
- 3.27 RenderView(String name, Boolean skipLayout)
- 3.28 RenderView(String controller, String name)
- 3.29 RenderView(String controller, String name, Boolean skipLayout)
- 3.30 InPlaceRenderView(TextWriter output, String name)
- 3.31 RenderSharedView(String name)
- 3.32 RenderSharedView(String name, Boolean skipLayout)
- 3.33 InPlaceRenderSharedView(TextWriter output, String name)
- 3.34 CancelView()
- 3.35 CancelLayout()
- 3.36 RenderText(String contents)
- 3.37 RenderText(String contents, Object[] args)
- 3.38 RenderText(IFormatProvider formatProvider, String contents, Object[] args)
- 3.39 DirectRender(String contents)
- 3.40 HasTemplate(String templateName)
: Boolean
- 3.41 RedirectToAction(String action)
- 3.42 RedirectToAction(String action, String[] queryStringParameters)
- 3.43 RedirectToAction(String action, IDictionary queryStringParameters)
- 3.44 RedirectToAction(String action, NameValueCollection queryStringParameters)
- 3.45 CreateAbsoluteRailsUrl(String area, String controller, String action)
: String
- 3.46 CreateAbsoluteRailsUrl(String controller, String action)
: String
- 3.47 CreateAbsoluteRailsUrlForAction(String action)
: String
- 3.48 Redirect(String controller, String action)
- 3.49 Redirect(String area, String controller, String action)
- 3.50 Redirect(String controller, String action, NameValueCollection parameters)
- 3.51 Redirect(String area, String controller, String action, NameValueCollection parameters)
- 3.52 Redirect(String controller, String action, IDictionary parameters)
- 3.53 Redirect(String area, String controller, String action, IDictionary parameters)
- 3.54 ToQueryString(NameValueCollection parameters)
: String
- 3.55 ToQueryString(IDictionary parameters)
: String
- 3.56 Send(String action)
- 3.57 Send(String action, Object[] actionArgs)
- 3.58 ShouldSkip(MethodInfo method, IDictionary filtersToSkip)
: Boolean
- 3.59 CopyFilterDescriptors()
: FilterDescriptor[]
- 3.60 RenderMailMessage(String templateName)
: Message
- 3.61 DeliverEmail(Message message)
- 3.62 RenderEmailAndSend(String templateName)
- 3.63 RaiseOnActionExceptionOnExtension()
SmartDispatcherController API Document
Specialization of Castle.MonoRail.Framework.Controller that tries to match the request params to method arguments.
Quick Note
You don't even need to always use databinding within arguments. Castle.MonoRail.Framework.SmartDispatcherController.BindObject(System.Type,System.String) and Castle.MonoRail.Framework.SmartDispatcherController.BindObjectInstance(System.Object,System.String) provides the same functionality to be used in place.
Constructors
SmartDispatcherController()
Initializes a new instance of the Castle.MonoRail.Framework.SmartDispatcherController class.
SmartDispatcherController(DataBinder binder)
Missing summary
| Parameter | Description |
|---|
| binder |
Missing documentation
|
Properties
| Name | Type | Description |
|---|
| Binder | DataBinder | |
| BoundInstanceErrors | IDictionary | |
| ParamsNode | CompositeNode |
Lazy initialized property with a hierarchical representation of the flat data on Castle.MonoRail.Framework.Controller.Params |
| FormNode | CompositeNode |
Lazy initialized property with a hierarchical representation of the flat data on Castle.MonoRail.Framework.IRequest.Form |
| QueryStringNode | CompositeNode |
Lazy initialized property with a hierarchical representation of the flat data on Castle.MonoRail.Framework.IRequest.QueryString |
| MetaDescriptor | ControllerMetaDescriptor |
This is intended to be used by MonoRail infrastructure.
|
| Actions | ICollection |
Gets the actions available in this controller.
|
| Resources | ResourceDictionary |
Gets a dicitionary of name/Castle.MonoRail.Framework.IResource |
| Helpers | IDictionary |
Gets a dictionary of name/helper instance
|
| Name | String |
Gets the controller's name.
|
| AreaName | String |
Gets the controller's area name.
|
| LayoutName | String |
Gets or set the layout being used.
|
| Action | String |
Gets the name of the action being processed.
|
| Logger | ILogger |
Logger for the controller
|
| SelectedViewName | String |
Gets or sets the view which will be rendered by this action.
|
| PropertyBag | IDictionary |
Gets the property bag, which is used to pass variables to the view.
|
| Context | IRailsEngineContext |
Gets the context of this request execution.
|
| Session | IDictionary |
Gets the Session dictionary.
|
| Flash | Flash |
Gets a dictionary of volative items. Ideal for showing success and failures messages.
|
| HttpContext | HttpContext |
Gets the web context of ASP.NET API.
|
| Request | IRequest |
Gets the request object.
|
| Response | IResponse |
Gets the response object.
|
| Params | NameValueCollection |
Shortcut to Castle.MonoRail.Framework.IRequest.Params |
| Form | NameValueCollection |
Shortcut to Castle.MonoRail.Framework.IRequest.Form |
| Query | NameValueCollection |
Shortcut to Castle.MonoRail.Framework.IRequest.QueryString |
| DynamicActions | IDictionary | |
| CustomActions | IDictionary | |
| IsClientConnected | Boolean |
Shortcut to Castle.MonoRail.Framework.IResponse.IsClientConnected |
| IsPostBack | Boolean |
Determines if the current Action resulted from an ASP.NET PostBack. As a result, this property is only relavent when using WebForms views. It is placed on the base Controller for convenience only to avoid the need to extend the Controller or provide additional helper classes.
|
| ServiceProvider | IServiceProvider | |
Methods
BuildMethodArguments(ParameterInfo[] parameters, IRequest request, Object[] actionArgs)
: Object[]
Returns an array that hopefully fills the arguments of the selected action.
Quick Note
Each parameter is inspected and we try to obtain an implementation of Castle.MonoRail.Framework.IParameterBinder from the attributes the parameter have (if any). If an implementation is found, it's used to fill the value for that parameter. Otherwise we use simple conversion to obtain the value.
| Parameter | Description |
|---|
| parameters |
Parameters to obtain the values to
|
| request |
The current request, which is the source to obtain the data
|
| actionArgs |
Extra arguments to pass to the action.
|
GetRequestParameterName(ParameterInfo param)
: String
Missing summary
| Parameter | Description |
|---|
| param |
Missing documentation
|
SelectBestCandidate(MethodInfo[] candidates, NameValueCollection webParams, Object[] actionArgs)
: MethodInfo
Missing summary
| Parameter | Description |
|---|
| candidates |
Missing documentation
|
| webParams |
Missing documentation
|
| actionArgs |
Missing documentation
|
PostSendView(Object view)
Invoked by the view engine to perform any logic after the view had been sent to the client.
| Parameter | Description |
|---|
| view |
Missing documentation
|
PreSendView(Object view)
Invoked by the view engine to perform any logic before the view is sent to the client.
| Parameter | Description |
|---|
| view |
Missing documentation
|
Initialize()
Missing summary
GetRescueFor(IList rescues, Type exceptionType)
: RescueDescriptor
| Parameter | Description |
|---|
| rescues |
Missing documentation
|
| exceptionType |
Missing documentation
|
PerformRescue(MethodInfo method, Exception ex)
: Boolean
| Parameter | Description |
|---|
| method |
Missing documentation
|
| ex |
Missing documentation
|
ObtainDefaultLayoutName()
: String
ReleaseResources()
CreateResources(MethodInfo method)
| Parameter | Description |
|---|
| method |
Missing documentation
|
InvokeMethod(MethodInfo method, IRequest request, Object[] actionArgs)
Missing summary
| Parameter | Description |
|---|
| method |
Missing documentation
|
| request |
Missing documentation
|
| actionArgs |
Missing documentation
|
SelectMethod(String action, IDictionary actions, IRequest request, Object[] actionArgs)
: MethodInfo
Missing summary
| Parameter | Description |
|---|
| action |
Missing documentation
|
| actions |
Missing documentation
|
| request |
Missing documentation
|
| actionArgs |
Missing documentation
|
CreateAndInitializeHelpers()
InternalSend(String action, Object[] actionArgs)
Performs the specified action, which means:
1. Define the default view name
2. Run the before filters
3. Select the method related to the action name and invoke it
4. On error, execute the rescues if available
5. Run the after filters
6. Invoke the view engine
| Parameter | Description |
|---|
| action |
Missing documentation
|
| actionArgs |
Missing documentation
|
Redirect(String url, IDictionary parameters)
Redirects to the specified URL.
| Parameter | Description |
|---|
| url |
Missing documentation
|
| parameters |
Missing documentation
|
Redirect(String url)
Redirects to the specified URL. All other Redirects call this one.
| Parameter | Description |
|---|
| url |
Missing documentation
|
CalculatePoints(MethodInfo candidate, NameValueCollection webParams, Object[] actionArgs)
: Int32
Uses a simplest algorithm to compute points for a method based on parameters available, which in turn reflects the best method is the one which the parameters will be able to satistfy more arguments
| Parameter | Description |
|---|
| candidate |
The method candidate
|
| webParams |
Parameter source
|
| actionArgs |
Extra parameters
|
BindObject(Type targetType, String prefix)
: Object
Missing summary
| Parameter | Description |
|---|
| targetType |
Missing documentation
|
| prefix |
Missing documentation
|
BindObject(ParamStore from, Type targetType, String prefix)
: Object
Missing summary
| Parameter | Description |
|---|
| from |
Missing documentation
|
| targetType |
Missing documentation
|
| prefix |
Missing documentation
|
BindObject(ParamStore from, Type targetType, String prefix, String excludedProperties, String allowedProperties)
: Object
Missing summary
| Parameter | Description |
|---|
| from |
Missing documentation
|
| targetType |
Missing documentation
|
| prefix |
Missing documentation
|
| excludedProperties |
Missing documentation
|
| allowedProperties |
Missing documentation
|
BindObjectInstance(Object instance, String prefix)
Missing summary
| Parameter | Description |
|---|
| instance |
Missing documentation
|
| prefix |
Missing documentation
|
BindObjectInstance(Object instance, ParamStore from, String prefix)
Missing summary
| Parameter | Description |
|---|
| instance |
Missing documentation
|
| from |
Missing documentation
|
| prefix |
Missing documentation
|
GetDataBindErrors(Object instance)
: ErrorList
Missing summary
| Parameter | Description |
|---|
| instance |
Missing documentation
|
ObtainParamsNode(ParamStore from)
: CompositeNode
This method is for internal use only
RenderView(String name)
Specifies the view to be processed after the action has finished its processing.
| Parameter | Description |
|---|
| name |
Missing documentation
|
RenderView(String name, Boolean skipLayout)
Specifies the view to be processed after the action has finished its processing.
| Parameter | Description |
|---|
| name |
Missing documentation
|
| skipLayout |
Missing documentation
|
RenderView(String controller, String name)
Specifies the view to be processed after the action has finished its processing.
| Parameter | Description |
|---|
| controller |
Missing documentation
|
| name |
Missing documentation
|
RenderView(String controller, String name, Boolean skipLayout)
Specifies the view to be processed after the action has finished its processing.
| Parameter | Description |
|---|
| controller |
Missing documentation
|
| name |
Missing documentation
|
| skipLayout |
Missing documentation
|
InPlaceRenderView(TextWriter output, String name)
Specifies the view to be processed and results are written to System.IO.TextWriter.
| Parameter | Description |
|---|
| output |
Missing documentation
|
| name |
Missing documentation
|
RenderSharedView(String name)
Specifies the shared view to be processed after the action has finished its processing. (A partial view shared by others views and usually in the root folder of the view directory).
| Parameter | Description |
|---|
| name |
Missing documentation
|
RenderSharedView(String name, Boolean skipLayout)
Specifies the shared view to be processed after the action has finished its processing. (A partial view shared by others views and usually in the root folder of the view directory).
| Parameter | Description |
|---|
| name |
Missing documentation
|
| skipLayout |
Missing documentation
|
InPlaceRenderSharedView(TextWriter output, String name)
Specifies the shared view to be processed and results are written to System.IO.TextWriter. (A partial view shared by others views and usually in the root folder of the view directory).
| Parameter | Description |
|---|
| output |
Missing documentation
|
| name |
Missing documentation
|
CancelView()
Cancels the view processing.
CancelLayout()
Cancels the layout processing.
RenderText(String contents)
Cancels the view processing and writes the specified contents to the browser
| Parameter | Description |
|---|
| contents |
Missing documentation
|
RenderText(String contents, Object[] args)
Cancels the view processing and writes the specified contents to the browser
| Parameter | Description |
|---|
| contents |
Missing documentation
|
| args |
Missing documentation
|
RenderText(IFormatProvider formatProvider, String contents, Object[] args)
Cancels the view processing and writes the specified contents to the browser
| Parameter | Description |
|---|
| formatProvider |
Missing documentation
|
| contents |
Missing documentation
|
| args |
Missing documentation
|
DirectRender(String contents)
Sends raw contents to be rendered directly by the view engine. It's up to the view engine just to apply the layout and nothing else.
| Parameter | Description |
|---|
| contents |
Missing documentation
|
HasTemplate(String templateName)
: Boolean
Returns true if the specified template exists.
| Parameter | Description |
|---|
| templateName |
Missing documentation
|
RedirectToAction(String action)
Redirects to another action in the same controller.
| Parameter | Description |
|---|
| action |
Missing documentation
|
RedirectToAction(String action, String[] queryStringParameters)
Redirects to another action in the same controller.
| Parameter | Description |
|---|
| action |
Missing documentation
|
| queryStringParameters |
Missing documentation
|
RedirectToAction(String action, IDictionary queryStringParameters)
Redirects to another action in the same controller.
| Parameter | Description |
|---|
| action |
Missing documentation
|
| queryStringParameters |
Missing documentation
|
RedirectToAction(String action, NameValueCollection queryStringParameters)
Redirects to another action in the same controller.
| Parameter | Description |
|---|
| action |
Missing documentation
|
| queryStringParameters |
Missing documentation
|
CreateAbsoluteRailsUrl(String area, String controller, String action)
: String
| Parameter | Description |
|---|
| area |
Missing documentation
|
| controller |
Missing documentation
|
| action |
Missing documentation
|
CreateAbsoluteRailsUrl(String controller, String action)
: String
| Parameter | Description |
|---|
| controller |
Missing documentation
|
| action |
Missing documentation
|
CreateAbsoluteRailsUrlForAction(String action)
: String
| Parameter | Description |
|---|
| action |
Missing documentation
|
Redirect(String controller, String action)
Redirects to another controller and action.
| Parameter | Description |
|---|
| controller |
Missing documentation
|
| action |
Missing documentation
|
Redirect(String area, String controller, String action)
Redirects to another controller and action.
| Parameter | Description |
|---|
| area |
Missing documentation
|
| controller |
Missing documentation
|
| action |
Missing documentation
|
Redirect(String controller, String action, NameValueCollection parameters)
Redirects to another controller and action with the specified paramters.
| Parameter | Description |
|---|
| controller |
Missing documentation
|
| action |
Missing documentation
|
| parameters |
Missing documentation
|
Redirect(String area, String controller, String action, NameValueCollection parameters)
Redirects to another controller and action with the specified paramters.
| Parameter | Description |
|---|
| area |
Missing documentation
|
| controller |
Missing documentation
|
| action |
Missing documentation
|
| parameters |
Missing documentation
|
Redirect(String controller, String action, IDictionary parameters)
Redirects to another controller and action with the specified paramters.
| Parameter | Description |
|---|
| controller |
Missing documentation
|
| action |
Missing documentation
|
| parameters |
Missing documentation
|
Redirect(String area, String controller, String action, IDictionary parameters)
Redirects to another controller and action with the specified paramters.
| Parameter | Description |
|---|
| area |
Missing documentation
|
| controller |
Missing documentation
|
| action |
Missing documentation
|
| parameters |
Missing documentation
|
ToQueryString(NameValueCollection parameters)
: String
| Parameter | Description |
|---|
| parameters |
Missing documentation
|
ToQueryString(IDictionary parameters)
: String
| Parameter | Description |
|---|
| parameters |
Missing documentation
|
Send(String action)
Performs the specified action, which means:
1. Define the default view name
2. Run the before filters
3. Select the method related to the action name and invoke it
4. On error, execute the rescues if available
5. Run the after filters
6. Invoke the view engine
| Parameter | Description |
|---|
| action |
Missing documentation
|
Send(String action, Object[] actionArgs)
Performs the specified action with arguments.
| Parameter | Description |
|---|
| action |
Missing documentation
|
| actionArgs |
Missing documentation
|
ShouldSkip(MethodInfo method, IDictionary filtersToSkip)
: Boolean
| Parameter | Description |
|---|
| method |
Missing documentation
|
| filtersToSkip |
Missing documentation
|
CopyFilterDescriptors()
: FilterDescriptor[]
Clones all Filter descriptors, in order to get a writable copy.
RenderMailMessage(String templateName)
: Message
Creates an instance of Castle.Components.Common.EmailSender.Message using the specified template for the body
| Parameter | Description |
|---|
| templateName |
Missing documentation
|
DeliverEmail(Message message)
Attempts to deliver the Message using the server specified on the web.config.
| Parameter | Description |
|---|
| message |
Missing documentation
|
RenderEmailAndSend(String templateName)
Renders and delivers the e-mail message.
| Parameter | Description |
|---|
| templateName |
Missing documentation
|
RaiseOnActionExceptionOnExtension()