C# Класс Mustachio.Parser

The main entry point for this library. Use the static "Parse" methods to create template functions. Functions are safe for reuse, so you may parse and cache the resulting function.
Показать файл Открыть проект

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

Метод Описание
Parse ( string template, bool disableContentEscaping = false ) : Func,String>

Parse the template content, producing a function that can be used to apply variables to the template. The provided function can be reused (i.e. no state will "leak" from one application of the function to the next).

ParseWithModelInference ( string templateSource, bool disableContentEscaping = false ) : ExtendedParseInformation

Parse the template, and capture paths used in the template to determine a suitable structure for the required model.

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

Метод Описание
HandleCollectionOpen ( TokenPair token, Queue remainder, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HandleContent ( string token ) : ContextObject>.Action
HandleElementOpen ( TokenPair token, Queue remainder, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HandleInvertedElementOpen ( TokenPair token, Queue remainder, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HandleSingleValue ( TokenPair token, ParsingOptions options, InferredTemplateModel scope ) : ContextObject>.Action
HtmlEncodeString ( string context ) : string
Parse ( Queue tokens, ParsingOptions options, InferredTemplateModel currentScope = null ) : ContextObject>.Action

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

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

Parse the template content, producing a function that can be used to apply variables to the template. The provided function can be reused (i.e. no state will "leak" from one application of the function to the next).
public static Parse ( string template, bool disableContentEscaping = false ) : Func,String>
template string The content of the template to be parsed.
disableContentEscaping bool In some cases, content should not be escaped (such as when rendering text bodies and subjects in emails). /// By default, we use content escaping, but this parameter allows it to be disabled.
Результат Func,String>

ParseWithModelInference() публичный статический Метод

Parse the template, and capture paths used in the template to determine a suitable structure for the required model.
public static ParseWithModelInference ( string templateSource, bool disableContentEscaping = false ) : ExtendedParseInformation
templateSource string The template content to parse.
disableContentEscaping bool In some cases, content should not be escaped (such as when rendering text bodies and subjects in emails). /// By default, we use content escaping, but this parameter allows it to be disabled.
Результат ExtendedParseInformation