Class TOrderedCollection

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TOrderedCollection = class(TCollection)

Description

TOrderedCollection is a base class for collections that avoid deleting their collection items during assign whenever they can. TOrderedCollection is typically used to allow editing of the collection in a GUI. The model owns (directly or indirectly) one copy of the TOrderedCollection. Another copy will be created in the GUI in which Model will be Nil. The user will edit this latter copy in the GUI. The copy then gets assigned back to the original copy.

See also
Assign
Assign copies the source TOrderedCollection to itself.

Hierarchy

Overview

Fields

Private FModel: TBaseModel;

Methods

Protected procedure InvalidateModel; virtual;
Public function First: TCollectionItem;
Public function Last: TCollectionItem;
Public function IsSame(AnOrderedCollection: TOrderedCollection): boolean; virtual;
Public constructor Create(ItemClass: TCollectionItemClass; Model: TBaseModel);
Public procedure Assign(Source: TPersistent); override;

Properties

Public property Model: TBaseModel read FModel;

Description

Fields

Private FModel: TBaseModel;

See Model.

Methods

Protected procedure InvalidateModel; virtual;

InvalidateModel invalidates the model.

See also
Invalidate
Call Invalidate to indicate that the model has changed in some important respect.
Public function First: TCollectionItem;
 
Public function Last: TCollectionItem;
 
Public function IsSame(AnOrderedCollection: TOrderedCollection): boolean; virtual;

IsSame tests whether the contents of AnOrderedCollection are the same as the current TOrderedCollection.

Public constructor Create(ItemClass: TCollectionItemClass; Model: TBaseModel);

Create creates an instance of TOrderedCollection.

Parameters
ItemClass
ItemClass must be a descendant of TOrderedItem.
Model
Model must be a TPhastModel or nil.
Public procedure Assign(Source: TPersistent); override;

Assign copies the source TOrderedCollection to itself. If Model is nil, it uses the inherited method which causes it to delete all its items, and copy new ones from the source. If Model is assigned,

  • existing items will be copied back to the items from which they were originally copied.

  • items deleted in the copy will be deleted in the original.

  • new items created in the copy will be inserted into the original at the same position.

Properties

Public property Model: TBaseModel read FModel;

Model is a TPhastModel or nil.


Generated by PasDoc 0.12.1 on 2013-05-13 15:41:54