C# Class Castle.MonoRail.Framework.Controller

Implements the core functionality and exposes the common methods for concrete controllers.
Inheritance: IAsyncController, IValidatorAccessor, IRedirectSupport
Afficher le fichier Open project: nats/castle-1.0.3-mono Class Usage Examples

Private Properties

Свойство Type Description
RedirectToReferer void
ResetIsPostback void
SetEvaluatedAction void
TransformActionName string

Méthodes publiques

Méthode Description
CancelLayout ( ) : void

Cancels the layout processing.

CancelView ( ) : void

Cancels the view processing.

Controller ( ) : System

Constructs a Controller

DeliverEmail ( Message message ) : void

Attempts to deliver the Message using the server specified on the web.config.

DirectRender ( string contents ) : void

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.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

HasTemplate ( string templateName ) : bool

Returns true if the specified template exists.

InPlaceRenderSharedView ( TextWriter output, string name ) : void

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).

InPlaceRenderView ( TextWriter output, string name ) : void

Specifies the view to be processed and results are written to System.IO.TextWriter.

InitializeControllerState ( string areaName, string controllerName, string actionName ) : void

Initializes the state of the controller.

InitializeFieldsFromServiceProvider ( IRailsEngineContext context ) : void

Extracts the services the controller uses from the context -- which ultimately is a service provider.

PostSendView ( object view ) : void

Invoked by the view engine to perform any logic after the view had been sent to the client.

PreSendView ( object view ) : void

Invoked by the view engine to perform any logic before the view is sent to the client.

Redirect ( string url ) : void

Redirects to the specified URL. All other Redirects call this one.

Redirect ( string url, IDictionary parameters ) : void

Redirects to the specified URL.

Redirect ( string url, NameValueCollection parameters ) : void

Redirects to the specified URL.

Redirect ( string controller, string action ) : void

Redirects to another controller and action.

Redirect ( string controller, string action, IDictionary parameters ) : void

Redirects to another controller and action with the specified paramters.

Redirect ( string controller, string action, NameValueCollection parameters ) : void

Redirects to another controller and action with the specified paramters.

Redirect ( string area, string controller, string action ) : void

Redirects to another controller and action.

Redirect ( string area, string controller, string action, IDictionary parameters ) : void

Redirects to another controller and action with the specified paramters.

Redirect ( string area, string controller, string action, NameValueCollection parameters ) : void

Redirects to another controller and action with the specified paramters.

RedirectToSiteRoot ( ) : void

Redirects to the site root directory (Context.ApplicationPath + "/").

RenderEmailAndSend ( string templateName ) : void

Renders and delivers the e-mail message. DeliverEmail

RenderMailMessage ( string templateName ) : Message

Creates an instance of Message using the specified template for the body

RenderMailMessage ( string templateName, bool doNotApplyLayout ) : Message

Creates an instance of Message using the specified template for the body

RenderSharedView ( string name ) : void

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).

RenderSharedView ( string name, bool skipLayout ) : void

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).

RenderText ( IFormatProvider formatProvider, string contents ) : void

Cancels the view processing and writes the specified contents to the browser

RenderText ( string contents ) : void

Cancels the view processing and writes the specified contents to the browser

RenderView ( string name ) : void

Specifies the view to be processed after the action has finished its processing.

RenderView ( string name, bool skipLayout ) : void

Specifies the view to be processed after the action has finished its processing.

RenderView ( string name, bool skipLayout, string mimeType ) : void

Specifies the view to be processed after the action has finished its processing.

RenderView ( string controller, string name ) : void

Specifies the view to be processed after the action has finished its processing.

RenderView ( string controller, string name, bool skipLayout ) : void

Specifies the view to be processed after the action has finished its processing.

RenderView ( string controller, string name, bool skipLayout, string mimeType ) : void

Specifies the view to be processed after the action has finished its processing.

RenderView ( string controller, string name, string mimeType ) : void

Specifies the view to be processed after the action has finished its processing.

Send ( string action ) : void

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

Send ( string action, IDictionary actionArgs ) : void

Performs the specified action with arguments.

Méthodes protégées

Méthode Description
CreateValidatorRunner ( IValidatorRegistry validatorRegistry ) : Castle.Components.Validator.ValidatorRunner

Creates the default validator runner.

You can override this method to create a runner with some different configuration

Initialize ( ) : void

Initializes this instance. Implementors can use this method to perform initialization

InternalSend ( string action, IDictionary actionArgs ) : void

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

InvokeMethod ( MethodInfo method, IDictionary methodArgs ) : void

Pendent

InvokeMethod ( MethodInfo method, IRequest request, IDictionary methodArgs ) : void

Pendent

RedirectToAction ( string action ) : void

Redirects to another action in the same controller.

RedirectToAction ( string action, IDictionary queryStringParameters ) : void

Redirects to another action in the same controller.

RedirectToAction ( string action, NameValueCollection queryStringParameters ) : void

Redirects to another action in the same controller.

RedirectToReferrer ( ) : void

Redirects to the referrer action, according to the "HTTP_REFERER" header (Context.UrlReferrer).

SelectMethod ( string action, IDictionary actions, IRequest request, IDictionary actionArgs ) : MethodInfo

Pendent

ToQueryString ( IDictionary parameters ) : string

Creates a querystring string representation of the entries in the dictionary.

ToQueryString ( NameValueCollection parameters ) : string

Creates a querystring string representation of the namevalue collection.

Private Methods

Méthode Description
RedirectToReferer ( ) : void
ResetIsPostback ( ) : void

To preserve standard Action semantics when using ASP.NET Views, the event handlers in the CodeBehind typically call Send(String). As a result, the IsPostBack property must be logically cleared to allow the Action to behave as if it was called directly.

SetEvaluatedAction ( string actionName ) : void

Sets the evaluated action.

TransformActionName ( string action ) : string

Gives a chance to subclasses to format the action name properly WizardStepPage

Method Details

CancelLayout() public méthode

Cancels the layout processing.
public CancelLayout ( ) : void
Résultat void

CancelView() public méthode

Cancels the view processing.
public CancelView ( ) : void
Résultat void

Controller() public méthode

Constructs a Controller
public Controller ( ) : System
Résultat System

CreateValidatorRunner() protected méthode

Creates the default validator runner.
You can override this method to create a runner with some different configuration
protected CreateValidatorRunner ( IValidatorRegistry validatorRegistry ) : Castle.Components.Validator.ValidatorRunner
validatorRegistry IValidatorRegistry The validator registry.
Résultat Castle.Components.Validator.ValidatorRunner

DeliverEmail() public méthode

Attempts to deliver the Message using the server specified on the web.config.
public DeliverEmail ( Message message ) : void
message Message The instance of System.Web.Mail.MailMessage that will be sent
Résultat void

DirectRender() public méthode

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.
public DirectRender ( string contents ) : void
contents string Contents to be rendered.
Résultat void

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

HasTemplate() public méthode

Returns true if the specified template exists.
public HasTemplate ( string templateName ) : bool
templateName string
Résultat bool

InPlaceRenderSharedView() public méthode

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).
public InPlaceRenderSharedView ( TextWriter output, string name ) : void
output System.IO.TextWriter
name string The name of the view to process.
Résultat void

InPlaceRenderView() public méthode

Specifies the view to be processed and results are written to System.IO.TextWriter.
public InPlaceRenderView ( TextWriter output, string name ) : void
output System.IO.TextWriter
name string The name of the view to process.
Résultat void

Initialize() protected méthode

Initializes this instance. Implementors can use this method to perform initialization
protected Initialize ( ) : void
Résultat void

InitializeControllerState() public méthode

Initializes the state of the controller.
public InitializeControllerState ( string areaName, string controllerName, string actionName ) : void
areaName string Name of the area.
controllerName string Name of the controller.
actionName string Name of the action.
Résultat void

InitializeFieldsFromServiceProvider() public méthode

Extracts the services the controller uses from the context -- which ultimately is a service provider.
public InitializeFieldsFromServiceProvider ( IRailsEngineContext context ) : void
context IRailsEngineContext The context/service provider.
Résultat void

InternalSend() protected méthode

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
protected InternalSend ( string action, IDictionary actionArgs ) : void
action string Action name
actionArgs IDictionary Action arguments
Résultat void

InvokeMethod() protected méthode

Pendent
protected InvokeMethod ( MethodInfo method, IDictionary methodArgs ) : void
method System.Reflection.MethodInfo
methodArgs IDictionary
Résultat void

InvokeMethod() protected méthode

Pendent
protected InvokeMethod ( MethodInfo method, IRequest request, IDictionary methodArgs ) : void
method System.Reflection.MethodInfo
request IRequest
methodArgs IDictionary
Résultat void

PostSendView() public méthode

Invoked by the view engine to perform any logic after the view had been sent to the client.
public PostSendView ( object view ) : void
view object
Résultat void

PreSendView() public méthode

Invoked by the view engine to perform any logic before the view is sent to the client.
public PreSendView ( object view ) : void
view object
Résultat void

Redirect() public méthode

Redirects to the specified URL. All other Redirects call this one.
public Redirect ( string url ) : void
url string Target URL
Résultat void

Redirect() public méthode

Redirects to the specified URL.
public Redirect ( string url, IDictionary parameters ) : void
url string Target URL
parameters IDictionary URL parameters
Résultat void

Redirect() public méthode

Redirects to the specified URL.
public Redirect ( string url, NameValueCollection parameters ) : void
url string Target URL
parameters System.Collections.Specialized.NameValueCollection URL parameters
Résultat void

Redirect() public méthode

Redirects to another controller and action.
public Redirect ( string controller, string action ) : void
controller string Controller name
action string Action name
Résultat void

Redirect() public méthode

Redirects to another controller and action with the specified paramters.
public Redirect ( string controller, string action, IDictionary parameters ) : void
controller string Controller name
action string Action name
parameters IDictionary Key/value pairings
Résultat void

Redirect() public méthode

Redirects to another controller and action with the specified paramters.
public Redirect ( string controller, string action, NameValueCollection parameters ) : void
controller string Controller name
action string Action name
parameters System.Collections.Specialized.NameValueCollection Key/value pairings
Résultat void

Redirect() public méthode

Redirects to another controller and action.
public Redirect ( string area, string controller, string action ) : void
area string Area name
controller string Controller name
action string Action name
Résultat void

Redirect() public méthode

Redirects to another controller and action with the specified paramters.
public Redirect ( string area, string controller, string action, IDictionary parameters ) : void
area string Area name
controller string Controller name
action string Action name
parameters IDictionary Key/value pairings
Résultat void

Redirect() public méthode

Redirects to another controller and action with the specified paramters.
public Redirect ( string area, string controller, string action, NameValueCollection parameters ) : void
area string Area name
controller string Controller name
action string Action name
parameters System.Collections.Specialized.NameValueCollection Key/value pairings
Résultat void

RedirectToAction() protected méthode

Redirects to another action in the same controller.
protected RedirectToAction ( string action ) : void
action string The action name
Résultat void

RedirectToAction() protected méthode

Redirects to another action in the same controller.
protected RedirectToAction ( string action, IDictionary queryStringParameters ) : void
action string The action name
queryStringParameters IDictionary Query string entries
Résultat void

RedirectToAction() protected méthode

Redirects to another action in the same controller.
protected RedirectToAction ( string action, NameValueCollection queryStringParameters ) : void
action string The action name
queryStringParameters System.Collections.Specialized.NameValueCollection Query string entries
Résultat void

RedirectToReferrer() protected méthode

Redirects to the referrer action, according to the "HTTP_REFERER" header (Context.UrlReferrer).
protected RedirectToReferrer ( ) : void
Résultat void

RedirectToSiteRoot() public méthode

Redirects to the site root directory (Context.ApplicationPath + "/").
public RedirectToSiteRoot ( ) : void
Résultat void

RenderEmailAndSend() public méthode

Renders and delivers the e-mail message. DeliverEmail
public RenderEmailAndSend ( string templateName ) : void
templateName string
Résultat void

RenderMailMessage() public méthode

Creates an instance of Message using the specified template for the body
public RenderMailMessage ( string templateName ) : Message
templateName string /// Name of the template to load. /// Will look in Views/mail for that template file. ///
Résultat Message

RenderMailMessage() public méthode

Creates an instance of Message using the specified template for the body
public RenderMailMessage ( string templateName, bool doNotApplyLayout ) : Message
templateName string /// Name of the template to load. /// Will look in Views/mail for that template file. ///
doNotApplyLayout bool If true, it will skip the layout
Résultat Message

RenderSharedView() public méthode

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).
public RenderSharedView ( string name ) : void
name string
Résultat void

RenderSharedView() public méthode

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).
public RenderSharedView ( string name, bool skipLayout ) : void
name string
skipLayout bool
Résultat void

RenderText() public méthode

Cancels the view processing and writes the specified contents to the browser
public RenderText ( IFormatProvider formatProvider, string contents ) : void
formatProvider IFormatProvider
contents string
Résultat void

RenderText() public méthode

Cancels the view processing and writes the specified contents to the browser
public RenderText ( string contents ) : void
contents string
Résultat void

RenderView() public méthode

Specifies the view to be processed after the action has finished its processing.
public RenderView ( string name ) : void
name string view template name (the file extension is optional)
Résultat void

RenderView() public méthode

Specifies the view to be processed after the action has finished its processing.
public RenderView ( string name, bool skipLayout ) : void
name string view template name (the file extension is optional)
skipLayout bool If set to true, no layout will be used when rendering the view
Résultat void

RenderView() public méthode

Specifies the view to be processed after the action has finished its processing.
public RenderView ( string name, bool skipLayout, string mimeType ) : void
name string view template name (the file extension is optional)
skipLayout bool If set to true, no layout will be used when rendering the view
mimeType string The mime type to use on the reply
Résultat void

RenderView() public méthode

Specifies the view to be processed after the action has finished its processing.
public RenderView ( string controller, string name ) : void
controller string Controller name get view from (if you intend to user another controller's view
name string view template name (the file extension is optional)
Résultat void

RenderView() public méthode

Specifies the view to be processed after the action has finished its processing.
public RenderView ( string controller, string name, bool skipLayout ) : void
controller string Controller name get view from (if you intend to user another controller's view
name string view template name (the file extension is optional)
skipLayout bool If set to true, no layout will be used when rendering the view
Résultat void

RenderView() public méthode

Specifies the view to be processed after the action has finished its processing.
public RenderView ( string controller, string name, bool skipLayout, string mimeType ) : void
controller string Controller name get view from (if you intend to user another controller's view
name string view template name (the file extension is optional)
skipLayout bool If set to true, no layout will be used when rendering the view
mimeType string The mime type to use on the reply
Résultat void

RenderView() public méthode

Specifies the view to be processed after the action has finished its processing.
public RenderView ( string controller, string name, string mimeType ) : void
controller string Controller name get view from (if you intend to user another controller's view
name string view template name (the file extension is optional)
mimeType string The mime type to use on the reply
Résultat void

SelectMethod() protected méthode

Pendent
protected SelectMethod ( string action, IDictionary actions, IRequest request, IDictionary actionArgs ) : MethodInfo
action string
actions IDictionary
request IRequest
actionArgs IDictionary
Résultat System.Reflection.MethodInfo

Send() public méthode

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
public Send ( string action ) : void
action string Action name
Résultat void

Send() public méthode

Performs the specified action with arguments.
public Send ( string action, IDictionary actionArgs ) : void
action string Action name
actionArgs IDictionary Action arguments
Résultat void

ToQueryString() protected méthode

Creates a querystring string representation of the entries in the dictionary.
protected ToQueryString ( IDictionary parameters ) : string
parameters IDictionary The parameters.
Résultat string

ToQueryString() protected méthode

Creates a querystring string representation of the namevalue collection.
protected ToQueryString ( NameValueCollection parameters ) : string
parameters System.Collections.Specialized.NameValueCollection The parameters.
Résultat string