C# Class Stubble.Core.Writer

Represents the Writer for Tokens and a wrapper over the Parser
Afficher le fichier Open project: StubbleOrg/Stubble Class Usage Examples

Private Properties

Свойство Type Description
RenderTokens string
ResetCurrentDepth void

Méthodes publiques

Méthode Description
ClearCache ( ) : void

Clears the Template Token Cache

Parse ( string template ) : IList

Parses a template, looks up the template in the template token cache and returns cached version if possible.

Parse ( string template, Tags tags ) : IList

Parses a template with the given tags, looks up the template in the template token cache and returns cached version if possible.

Render ( string template, Context context, string>.IDictionary partials ) : string

Takes a template, context and partials and Renders them using default tags

Render ( string template, Context context, string>.IDictionary partials, Tags tags ) : string

Takes a template, context, partials and tags and renders the template

Render ( string template, object view, string>.IDictionary partials, RenderSettings settings ) : string

Takes a template, view object, partials and render settings and Renders them using default tags

Writer ( ) : System

Initializes a new instance of the Writer class with a default Registry and a cache size of 15

Writer ( Registry registry ) : System

Initializes a new instance of the Writer class with a explicit registry and cacheSize of 15

Writer ( int cacheLimit, Registry registry ) : System

Initializes a new instance of the Writer class with a cacheLimit and explicit registry

Private Methods

Méthode Description
RenderTokens ( IList tokens, Context context, string>.IDictionary partials, string originalTemplate ) : string

Renders a list of tokens with the context, partials and passed original template

ResetCurrentDepth ( ) : void

Method Details

ClearCache() public méthode

Clears the Template Token Cache
public ClearCache ( ) : void
Résultat void

Parse() public méthode

Parses a template, looks up the template in the template token cache and returns cached version if possible.
public Parse ( string template ) : IList
template string The template to parse
Résultat IList

Parse() public méthode

Parses a template with the given tags, looks up the template in the template token cache and returns cached version if possible.
public Parse ( string template, Tags tags ) : IList
template string The template to parse
tags Stubble.Core.Classes.Tags The tags to parse the template with
Résultat IList

Render() public méthode

Takes a template, context and partials and Renders them using default tags
public Render ( string template, Context context, string>.IDictionary partials ) : string
template string The template to parse and render
context Context The context object to use
partials string>.IDictionary The partials available to the template
Résultat string

Render() public méthode

Takes a template, context, partials and tags and renders the template
public Render ( string template, Context context, string>.IDictionary partials, Tags tags ) : string
template string The template to parse and render
context Context The context object to use to render
partials string>.IDictionary The partials available to the template
tags Stubble.Core.Classes.Tags The tags to initalise the parser with
Résultat string

Render() public méthode

Takes a template, view object, partials and render settings and Renders them using default tags
public Render ( string template, object view, string>.IDictionary partials, RenderSettings settings ) : string
template string The template to parse and render
view object The view object to use to render
partials string>.IDictionary The partials available to the template
settings Stubble.Core.Classes.RenderSettings The settings to use for rendering
Résultat string

Writer() public méthode

Initializes a new instance of the Writer class with a default Registry and a cache size of 15
public Writer ( ) : System
Résultat System

Writer() public méthode

Initializes a new instance of the Writer class with a explicit registry and cacheSize of 15
public Writer ( Registry registry ) : System
registry Stubble.Core.Classes.Registry The registry to use
Résultat System

Writer() public méthode

Initializes a new instance of the Writer class with a cacheLimit and explicit registry
public Writer ( int cacheLimit, Registry registry ) : System
cacheLimit int The max size of the template token cache
registry Stubble.Core.Classes.Registry The registry to use
Résultat System