Declaration¶
Source position: classesh.inc line 881
type
TCollectionItem = class(TPersistent)
public
constructor Create;
destructor Destroy;
function GetNamePath : string;
property Collection: TCollection; {rw}
property ID: Integer; {r}
property Index: Integer; {rw}
property DisplayName: string; {rw}
end;
Inheritance¶
Description¶
TCollectionItem and TCollection form a pair of base classes that manage a collection of named objects. The TCollectionItem is the named object that is managed, it represents one item in the collection. An item in the collection is represented by three properties: TCollectionItem.DisplayName, TCollection.Index and TCollectionItem.ID.
A TCollectionItem object is never created directly. To manage a set of named items, it is necessary to make a descendant of TCollectionItem to which needed properties and methods are added. This descendant can then be managed with a TCollection class. The managing collection will create and destroy it's items by itself, it should therefore never be necessary to create TCollectionItem descendants manually.
Properties¶
| Member | Visibility | Description |
|---|---|---|
| Collection | public | Pointer to the collection managing this item. |
| DisplayName | public | Name of the item, displayed in the object inspector. |
| ID read only | public | Initial index of this item. |
| Index | public | Index of the item in its managing collection TCollection.Items property. |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| Create | public | Creates a new instance of this collection item. |
| Destroy | public | Destroys this collection item. |
| GetNamePath | public | Returns the namepath of this collection item. |
See also¶
| Name | Description |
|---|---|
| TCollection | Base class to manage collections of named objects. |