C# 클래스 Xipton.Razor.RazorMachine

The main razor template executer. Use a singleton instance because each instance creates its own type cache (at the template factory).
상속: IDisposable, IRazorMachine
파일 보기 프로젝트 열기: jlamfers/RazorMachine 1 사용 예제들

공개 메소드들

메소드 설명
ClearTypeCache ( ) : RazorMachine
Dispose ( ) : void
Execute ( string templateVirtualPathOrContent, object model = null, object viewbag = null, bool skipLayout = false, bool throwExceptionOnVirtualPathNotFound = true ) : ITemplate

Hybrid convenience executer. It decides whether to execute content or an url.

ExecuteContent ( string templateContent, object model = null, object viewbag = null, bool skipLayout = false ) : ITemplate

Renders the specified template content's result with the passed model instance and returns the template's rendered result. A corresponding virtual path is generated internally for being able to keep the compiled template type cached.

ExecuteUrl ( string templateVirtualPath, object model = null, object viewbag = null, bool skipLayout = false, bool throwExceptionOnVirtualPathNotFound = true ) : ITemplate

Executes the template by its virtual path and returns the resulting executed template instance.

GetRegisteredInMemoryTemplates ( ) : string>.IDictionary
RazorMachine ( ) : System
RazorMachine ( Xipton.Razor.Config.RazorConfig config ) : System
RazorMachine ( Type baseType = null, string rootOperatorPath = null, RazorCodeLanguage language = null, string defaultExtension = null, string autoIncludeNameWithoutExtension = null, string sharedLocation = null, bool includeGeneratedSourceCode = null, bool htmlEncode = null, IEnumerable references = null, IEnumerable namespaces = null, IEnumerable contentProviders = null, bool replaceReferences = false, bool replaceNamespaces = false, bool replaceContentProviders = false ) : System
RazorMachine ( string xmlContentOrFileName ) : System
RegisterTemplate ( string virtualPath, string content ) : RazorMachine
RemoveTemplate ( string virtualPath ) : RazorMachine

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void
NormalizeVirtualPath ( string virtualPath ) : string

메소드 상세

ClearTypeCache() 공개 메소드

public ClearTypeCache ( ) : RazorMachine
리턴 RazorMachine

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

Execute() 공개 메소드

Hybrid convenience executer. It decides whether to execute content or an url.
public Execute ( string templateVirtualPathOrContent, object model = null, object viewbag = null, bool skipLayout = false, bool throwExceptionOnVirtualPathNotFound = true ) : ITemplate
templateVirtualPathOrContent string Content of the template URL or.
model object The model.
viewbag object The viewbag.
skipLayout bool if set to true [skip layout].
throwExceptionOnVirtualPathNotFound bool if set to true [throw exception on virtual path not found].
리턴 ITemplate

ExecuteContent() 공개 메소드

Renders the specified template content's result with the passed model instance and returns the template's rendered result. A corresponding virtual path is generated internally for being able to keep the compiled template type cached.
public ExecuteContent ( string templateContent, object model = null, object viewbag = null, bool skipLayout = false ) : ITemplate
templateContent string Content of the template.
model object The model
viewbag object The optional viewbag
skipLayout bool if set to true then any layout setting (probably at _ViewStart) is ignored.
리턴 ITemplate

ExecuteUrl() 공개 메소드

Executes the template by its virtual path and returns the resulting executed template instance.
public ExecuteUrl ( string templateVirtualPath, object model = null, object viewbag = null, bool skipLayout = false, bool throwExceptionOnVirtualPathNotFound = true ) : ITemplate
templateVirtualPath string The requested virtual path for the template.
model object The optional model.
viewbag object The optional viewbag.
skipLayout bool if set true then any layout setting is ignored
throwExceptionOnVirtualPathNotFound bool /// Optional. If set to true an exception is thrown if the requested path could not be resolved. /// If set to false then null is returned if the requested path could not be resolved. ///
리턴 ITemplate

GetRegisteredInMemoryTemplates() 공개 메소드

public GetRegisteredInMemoryTemplates ( ) : string>.IDictionary
리턴 string>.IDictionary

NormalizeVirtualPath() 보호된 메소드

protected NormalizeVirtualPath ( string virtualPath ) : string
virtualPath string
리턴 string

RazorMachine() 공개 메소드

public RazorMachine ( ) : System
리턴 System

RazorMachine() 공개 메소드

public RazorMachine ( Xipton.Razor.Config.RazorConfig config ) : System
config Xipton.Razor.Config.RazorConfig
리턴 System

RazorMachine() 공개 메소드

public RazorMachine ( Type baseType = null, string rootOperatorPath = null, RazorCodeLanguage language = null, string defaultExtension = null, string autoIncludeNameWithoutExtension = null, string sharedLocation = null, bool includeGeneratedSourceCode = null, bool htmlEncode = null, IEnumerable references = null, IEnumerable namespaces = null, IEnumerable contentProviders = null, bool replaceReferences = false, bool replaceNamespaces = false, bool replaceContentProviders = false ) : System
baseType System.Type
rootOperatorPath string
language System.Web.Razor.RazorCodeLanguage
defaultExtension string
autoIncludeNameWithoutExtension string
sharedLocation string
includeGeneratedSourceCode bool
htmlEncode bool
references IEnumerable
namespaces IEnumerable
contentProviders IEnumerable
replaceReferences bool
replaceNamespaces bool
replaceContentProviders bool
리턴 System

RazorMachine() 공개 메소드

public RazorMachine ( string xmlContentOrFileName ) : System
xmlContentOrFileName string
리턴 System

RegisterTemplate() 공개 메소드

public RegisterTemplate ( string virtualPath, string content ) : RazorMachine
virtualPath string
content string
리턴 RazorMachine

RemoveTemplate() 공개 메소드

public RemoveTemplate ( string virtualPath ) : RazorMachine
virtualPath string
리턴 RazorMachine