RazorEngine


ITemplateManager

Defined in RazorEngine.dll.

Defines the required contract for implementing a template-manager.

Instance members

Instance memberDescription
AddDynamic(key, source)
Signature: (key:ITemplateKey * source:ITemplateSource) -> unit
Modifiers: abstract

Adds a template dynamically to the current manager.

GetKey(name, resolveType, context)
Signature: (name:string * resolveType:ResolveType * context:ITemplateKey) -> ITemplateKey
Modifiers: abstract

Get the key of a template. This method has to be implemented so that the manager can control the ITemplateKey implementation. This way the cache api can rely on the unique string given by ITemplateKey.GetUniqueKeyString.

Returns: the key for the template

Remarks

For example one template manager reads all template from a single folder, then the ITemplateKey.GetUniqueKeyString can simply return the template name. Another template manager can read from different folders depending whether we include a layout or including a template. In that situation the ITemplateKey.GetUniqueKeyString has to take that into account so that templates with the same name can not be confused.

Resolve(key)
Signature: key:ITemplateKey -> ITemplateSource
Modifiers: abstract

Resolves the template with the specified key.

Returns: The template content.

Fork me on GitHub