0

I need to register TCollection and TCollectionItem classes, but because of the properties of

{TCollection}
property Items [Index: Integer]: TCollectionItem
{TCollectionItem}
property Collection: TCollection

сonstantly raises the exception of the impossibility to find TCollectionItem/TCollectionItem type.

2 Answers2

0

If you register the class on you own within code, you could first register the TCollectionItem without the property Collection: TCollection, then register TCollection with property Items [Index: Integer]: TCollectionItem and afterwards adding the property Collection: TCollection to your TCollectionItem.

  • But exception is raised in DoGenerate procedure when code compiling. How I can register property Collection: TCollection before TCollection class registration??? – Alexey Ignatenko Sep 23 '16 at 11:29
0

You can use:

type
  TCollection = class;

  TCollectionItem = class
  published
    property Items: TCollection;
  end;

  TCollection = class
  published
    property Items [Index: Integer]: TCollectionItem;
  end;