C# Класс Castle.MonoRail.Framework.Controller

Implements the core functionality and exposes the common methods for concrete controllers.
Наследование: IAsyncController, IValidatorAccessor, IRedirectSupport
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
RedirectToReferer void
ResetIsPostback void
SetEvaluatedAction void
TransformActionName string

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CancelLayout() публичный Метод

Cancels the layout processing.
public CancelLayout ( ) : void
Результат void

CancelView() публичный Метод

Cancels the view processing.
public CancelView ( ) : void
Результат void

Controller() публичный Метод

Constructs a Controller
public Controller ( ) : System
Результат System

CreateValidatorRunner() защищенный Метод

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.
Результат Castle.Components.Validator.ValidatorRunner

DeliverEmail() публичный Метод

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
Результат void

DirectRender() публичный Метод

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.
Результат void

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

HasTemplate() публичный Метод

Returns true if the specified template exists.
public HasTemplate ( string templateName ) : bool
templateName string
Результат bool

InPlaceRenderSharedView() публичный Метод

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.
Результат void

InPlaceRenderView() публичный Метод

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.
Результат void

Initialize() защищенный Метод

Initializes this instance. Implementors can use this method to perform initialization
protected Initialize ( ) : void
Результат void

InitializeControllerState() публичный Метод

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.
Результат void

InitializeFieldsFromServiceProvider() публичный Метод

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.
Результат void

InternalSend() защищенный Метод

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
Результат void

InvokeMethod() защищенный Метод

Pendent
protected InvokeMethod ( MethodInfo method, IDictionary methodArgs ) : void
method System.Reflection.MethodInfo
methodArgs IDictionary
Результат void

InvokeMethod() защищенный Метод

Pendent
protected InvokeMethod ( MethodInfo method, IRequest request, IDictionary methodArgs ) : void
method System.Reflection.MethodInfo
request IRequest
methodArgs IDictionary
Результат void

PostSendView() публичный Метод

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
Результат void

PreSendView() публичный Метод

Invoked by the view engine to perform any logic before the view is sent to the client.
public PreSendView ( object view ) : void
view object
Результат void

Redirect() публичный Метод

Redirects to the specified URL. All other Redirects call this one.
public Redirect ( string url ) : void
url string Target URL
Результат void

Redirect() публичный Метод

Redirects to the specified URL.
public Redirect ( string url, IDictionary parameters ) : void
url string Target URL
parameters IDictionary URL parameters
Результат void

Redirect() публичный Метод

Redirects to the specified URL.
public Redirect ( string url, NameValueCollection parameters ) : void
url string Target URL
parameters System.Collections.Specialized.NameValueCollection URL parameters
Результат void

Redirect() публичный Метод

Redirects to another controller and action.
public Redirect ( string controller, string action ) : void
controller string Controller name
action string Action name
Результат void

Redirect() публичный Метод

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
Результат void

Redirect() публичный Метод

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
Результат void

Redirect() публичный Метод

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
Результат void

Redirect() публичный Метод

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
Результат void

Redirect() публичный Метод

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
Результат void

RedirectToAction() защищенный Метод

Redirects to another action in the same controller.
protected RedirectToAction ( string action ) : void
action string The action name
Результат void

RedirectToAction() защищенный Метод

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
Результат void

RedirectToAction() защищенный Метод

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
Результат void

RedirectToReferrer() защищенный Метод

Redirects to the referrer action, according to the "HTTP_REFERER" header (Context.UrlReferrer).
protected RedirectToReferrer ( ) : void
Результат void

RedirectToSiteRoot() публичный Метод

Redirects to the site root directory (Context.ApplicationPath + "/").
public RedirectToSiteRoot ( ) : void
Результат void

RenderEmailAndSend() публичный Метод

Renders and delivers the e-mail message. DeliverEmail
public RenderEmailAndSend ( string templateName ) : void
templateName string
Результат void

RenderMailMessage() публичный Метод

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. ///
Результат Message

RenderMailMessage() публичный Метод

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
Результат Message

RenderSharedView() публичный Метод

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
Результат void

RenderSharedView() публичный Метод

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
Результат void

RenderText() публичный Метод

Cancels the view processing and writes the specified contents to the browser
public RenderText ( IFormatProvider formatProvider, string contents ) : void
formatProvider IFormatProvider
contents string
Результат void

RenderText() публичный Метод

Cancels the view processing and writes the specified contents to the browser
public RenderText ( string contents ) : void
contents string
Результат void

RenderView() публичный Метод

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)
Результат void

RenderView() публичный Метод

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
Результат void

RenderView() публичный Метод

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
Результат void

RenderView() публичный Метод

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)
Результат void

RenderView() публичный Метод

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
Результат void

RenderView() публичный Метод

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
Результат void

RenderView() публичный Метод

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
Результат void

SelectMethod() защищенный Метод

Pendent
protected SelectMethod ( string action, IDictionary actions, IRequest request, IDictionary actionArgs ) : MethodInfo
action string
actions IDictionary
request IRequest
actionArgs IDictionary
Результат System.Reflection.MethodInfo

Send() публичный Метод

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
Результат void

Send() публичный Метод

Performs the specified action with arguments.
public Send ( string action, IDictionary actionArgs ) : void
action string Action name
actionArgs IDictionary Action arguments
Результат void

ToQueryString() защищенный Метод

Creates a querystring string representation of the entries in the dictionary.
protected ToQueryString ( IDictionary parameters ) : string
parameters IDictionary The parameters.
Результат string

ToQueryString() защищенный Метод

Creates a querystring string representation of the namevalue collection.
protected ToQueryString ( NameValueCollection parameters ) : string
parameters System.Collections.Specialized.NameValueCollection The parameters.
Результат string