C# Class Castle.MonoRail.Framework.ViewEngineBase

Abstract base class for View Engines.
Inheritance: IViewEngine, IServiceEnabledComponent
Show file Open project: nats/castle-1.0.3-mono

Protected Properties

Property Type Description
serviceProvider IServiceProvider

Public Methods

Method Description
CreateJSGenerator ( IRailsEngineContext context ) : object

Implementors should return a generator instance if the view engine supports JS generation.

GenerateJS ( IRailsEngineContext context, Controller controller, string templateName ) : void

Processes the js generation view template - using the templateName to obtain the correct template, and using the context to output the result.

GenerateJS ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void

Processes the js generation view template - using the templateName to obtain the correct template, and using the specified TextWriter to output the result.

HasTemplate ( String templateName ) : bool

Evaluates whether the specified template exists.

Process ( IRailsEngineContext context, Controller controller, String templateName ) : void

Processes the view - using the templateName to obtain the correct template, and using the context to output the result.

Process ( TextWriter output, IRailsEngineContext context, Controller controller, String templateName ) : void

Processes the view - using the templateName to obtain the correct template and writes the results to the System.IO.TextWriter.

ProcessContents ( IRailsEngineContext context, Controller controller, String contents ) : void

Wraps the specified content in the layout using the context to output the result.

ProcessPartial ( TextWriter output, IRailsEngineContext context, Controller controller, string partialName ) : void

Should process the specified partial. The partial name must contains the path relative to the views folder.

Service ( IServiceProvider provider ) : void

Services the specified provider.

Protected Methods

Method Description
AdjustContentType ( IRailsEngineContext context ) : void

Sets the HTTP Content-Type header appropriately.

AdjustJavascriptContentType ( IRailsEngineContext context ) : void

Sets the HTTP Content-Type header to text/javascript

PostSendView ( Controller controller, object view ) : void

Invokes the Controller.PostSendView

PreSendView ( Controller controller, object view ) : void

Invokes the Controller.PreSendView

Method Details

AdjustContentType() protected method

Sets the HTTP Content-Type header appropriately.
protected AdjustContentType ( IRailsEngineContext context ) : void
context IRailsEngineContext
return void

AdjustJavascriptContentType() protected method

Sets the HTTP Content-Type header to text/javascript
protected AdjustJavascriptContentType ( IRailsEngineContext context ) : void
context IRailsEngineContext
return void

CreateJSGenerator() public abstract method

Implementors should return a generator instance if the view engine supports JS generation.
public abstract CreateJSGenerator ( IRailsEngineContext context ) : object
context IRailsEngineContext The request context.
return object

GenerateJS() public method

Processes the js generation view template - using the templateName to obtain the correct template, and using the context to output the result.
public GenerateJS ( IRailsEngineContext context, Controller controller, string templateName ) : void
context IRailsEngineContext The request context.
controller Controller The controller.
templateName string Name of the template.
return void

GenerateJS() public abstract method

Processes the js generation view template - using the templateName to obtain the correct template, and using the specified TextWriter to output the result.
public abstract GenerateJS ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void
output System.IO.TextWriter The output.
context IRailsEngineContext The request context.
controller Controller The controller.
templateName string Name of the template.
return void

HasTemplate() public abstract method

Evaluates whether the specified template exists.
public abstract HasTemplate ( String templateName ) : bool
templateName String
return bool

PostSendView() protected method

Invokes the Controller.PostSendView
protected PostSendView ( Controller controller, object view ) : void
controller Controller The controller.
view object The view argument.
return void

PreSendView() protected method

Invokes the Controller.PreSendView
protected PreSendView ( Controller controller, object view ) : void
controller Controller The controller.
view object The view argument.
return void

Process() public abstract method

Processes the view - using the templateName to obtain the correct template, and using the context to output the result.
public abstract Process ( IRailsEngineContext context, Controller controller, String templateName ) : void
context IRailsEngineContext
controller Controller
templateName String
return void

Process() public abstract method

Processes the view - using the templateName to obtain the correct template and writes the results to the System.IO.TextWriter.
public abstract Process ( TextWriter output, IRailsEngineContext context, Controller controller, String templateName ) : void
output System.IO.TextWriter
context IRailsEngineContext
controller Controller
templateName String
return void

ProcessContents() public abstract method

Wraps the specified content in the layout using the context to output the result.
public abstract ProcessContents ( IRailsEngineContext context, Controller controller, String contents ) : void
context IRailsEngineContext
controller Controller
contents String
return void

ProcessPartial() public abstract method

Should process the specified partial. The partial name must contains the path relative to the views folder.
public abstract ProcessPartial ( TextWriter output, IRailsEngineContext context, Controller controller, string partialName ) : void
output System.IO.TextWriter The output.
context IRailsEngineContext The request context.
controller Controller The controller.
partialName string The partial name.
return void

Service() public method

Services the specified provider.
public Service ( IServiceProvider provider ) : void
provider IServiceProvider The provider.
return void

Property Details

serviceProvider protected property

The service provider instance
protected IServiceProvider serviceProvider
return IServiceProvider