type TStreamTemplates = class(TPersistent);
Streamable list of lists.
The class handles storing, loading, decoding and encoding of a list of streams. The list of streams is stored in the Templates property. Each stream holds another list of objects. This lists are of TStreamedList type. When the user sets the TemplateIndex or the TemplateName property, the appropriate stream is decoded to Template property, where individual objects contained in the list can be accessed. All changes to those objects are retained and Templates property is kept up-to-date. For TStreamTemplates to handle user defined type of objects, a new class should be derived from TStreamedList type.
Properties
| Name | Type | Description |
|---|---|---|
| Owner | TComponent | Returns the owner object. |
| Template | TStreamedList | Holds a list of objects. |
| TemplateIndex | Integer | Set TemplateIndex to decode the stream at position TemplateIndex to Template property. |
| TemplateName | string | Set TemplateName to decode the stream with name TemplateName to Template property. |
| Templates | TStringStreamList | Holds the list of streams containing data to be decoded to the Template property. |
Methods
| Name | Description |
|---|---|
| AddCopyTemplate | Add a new template named S to the list of templates and set TemplateIndex to point to the template added. |
| AddTemplate | Add a new template (TMemoryStream) named S to the list. |
| Clear | Clears the Templates and Template properties. |
| Consolidate | Call this method to ensure that Template and Templates properties are synchronized. |
| Delete | Delete the template at position Index from the Templates property. |
| LoadFromFile | Load the object from the file. |
| LoadFromStream | Load all data from the stream. |
| SaveToFile | Save the object to the file. |
| SaveToStream | Save all data to the stream. |
| Update | Calls the Template.Update method. |