C# Класс Stubble.Core.Writer

Represents the Writer for Tokens and a wrapper over the Parser
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
RenderTokens string
ResetCurrentDepth void

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

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

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

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

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

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

Clears the Template Token Cache
public ClearCache ( ) : void
Результат void

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

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

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

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

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

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

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

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

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

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

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

Initializes a new instance of the Writer class with a default Registry and a cache size of 15
public Writer ( ) : System
Результат System

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

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

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

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