Show/Hide Toolbars

RiverSoftAVG Products Help

Navigation: Code Documentation > RSCommon > Structures > Classes

TGCollectionItem Class

Scroll Prev Top Next More

Defines a TCollectionItem descendant that can refer to other collection items (TGCollectionItem) and notify them when it is destroyed. This class can only notify other TGCollectionItem classes. This class is similar to TComponent, which allows other TComponents to be informed when a component is removed.
 

Namespace: Structures

To be informed if another TGCollectionItem is freed, call the FreeNotification method of the other collection item:

Delphi

if SlotType <> nil then SlotType.FreeNotification(Self);

If you don't wish to be informed anymore, call the RemoveFreeNotification method:

Delphi

if SlotType <> nil then SlotType.RemoveFreeNotification(Self);

 
Finally, you need to override the Notification method to respond when the other collection item is freed. (The Notification method is protected):

Delphi

procedure TIEESTemplateSlotItem.Notification(Item: TGCollectionItem);
 begin
      inherited Notification(Item);
      if Item = FSlotType then
         SlotType := nil;
 end;

RiverSoftAVG Products Help © 1996-2016 Thomas G. Grubb