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.
파일 보기 프로젝트 열기: wildbit/mustachio

공개 메소드들

메소드 설명
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