C# Class RazorTemplates.Core.TemplateBase

Represents a base class for generated templates.
Mostrar archivo Open project: volkovku/RazorTemplates

Public Methods

Method Description
Execute ( ) : void

A method which implemets by Razor engine. Produces sequance like: WriteLiteral("Hello "); Write(Model.Name); WriteLiteral("!");

Render ( object model ) : string

Renders specified model.

Protected Methods

Method Description
Write ( object value ) : void

Writes a string representation of specified object.

Write ( string value ) : void

Writes a string.

WriteAttribute ( string attribute, PositionTagged prefix, PositionTagged suffix ) : void

Razor 2.0 Writes attribute in situations like <img src="@Model">.

WriteLiteral ( string value ) : void

Writes specified string.

Method Details

Execute() public abstract method

A method which implemets by Razor engine. Produces sequance like: WriteLiteral("Hello "); Write(Model.Name); WriteLiteral("!");
public abstract Execute ( ) : void
return void

Render() public method

Renders specified model.
public Render ( object model ) : string
model object
return string

Write() protected method

Writes a string representation of specified object.
protected Write ( object value ) : void
value object
return void

Write() protected method

Writes a string.
protected Write ( string value ) : void
value string
return void

WriteAttribute() protected method

Razor 2.0 Writes attribute in situations like <img src="@Model">.
protected WriteAttribute ( string attribute, PositionTagged prefix, PositionTagged suffix ) : void
attribute string
prefix PositionTagged
suffix PositionTagged
return void

WriteLiteral() protected method

Writes specified string.
protected WriteLiteral ( string value ) : void
value string
return void