Template Formatter allows for registering reusable templates, and use them by name.
Inheritance
TemplateFormatter
public class TemplateFormatter : FormatterBase, IFormatter, ISerializationCallbackReceiver
Constructors
Declaration
public TemplateFormatter(SmartFormatter formatter)
Parameters
Properties
Declaration
public override string[] DefaultNames { get; }
Property Value
Overrides
Methods
Declaration
Declaration
public void Register(string templateName, string template)
Parameters
Type |
Name |
Description |
String |
templateName |
A name for the template, which is not already registered.
|
String |
template |
The string to be used as a template.
|
Remove a template by its name.
Declaration
public bool Remove(string templateName)
Parameters
Type |
Name |
Description |
String |
templateName |
|
Returns
Declaration
public override bool TryEvaluateAllLiterals(IFormattingInfo formattingInfo)
Parameters
Returns
Overrides
This method is called by the SmartFormatter to obtain the formatting result of this extension.
Declaration
public override bool TryEvaluateFormat(IFormattingInfo formattingInfo)
Parameters
Returns
Type |
Description |
Boolean |
Returns true if successful, else false.
|
Overrides
Extension Methods