![]() | Template Class |
Namespace: Limilabs.Mail.Templates
The Template type exposes the following members.
Name | Description | |
---|---|---|
![]() | AddKey |
Adds a custom key used by this template.
|
![]() | ClearDataSources |
Clears all data sources for this template.
|
![]() ![]() | Create |
Creates new template using specified template text.
|
![]() | DataFrom(IDictionary) |
Specifies IDictionary that will be used as a data source for this template.
If the method is called more than once, only last object is used as the template data source.
|
![]() | DataFrom(Object) |
Specifies object that will be used as a data source for this template.
If the method is called more than once, only last object is used.
|
![]() | DataFrom(ITemplateDataProvider) |
Specifies ITemplateDataProvider that will be used as a data source for this template.
If the method is called more than once, only last object is used as the template data source.
|
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | FromFile |
Loads a template from file.
|
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | PermanentDataFrom(IDictionary) |
Specifies IDictionary that will be used as a data source for this template.
If the method is called more than once, all objects are checked and used as the template data source.
|
![]() | PermanentDataFrom(Object) |
Specifies object that will be used as a data source for this template.
If the method is called more than once, all objects are used.
|
![]() | PermanentDataFrom(ITemplateDataProvider) |
Specifies ITemplateDataProvider that will be used as a data source for this template.
If the method is called more than once, all objects are checked and used as the template data source.
|
![]() | Render |
Renders the template.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
string text = Template .LoadFromFile("template.txt") .DataFrom(reportData) .Render();
Hi [FirstName] [LastName], On [PurchaseDate:yyyy/MM/dd HH:mm] you purchased following items: [foreach OrderItems] - [Id] [Name] [Price] [end] \[ escaped square brackets \]