[英]How registrate two class with circular references in DWScript?
I need to register TCollection and TCollectionItem classes, but because of the properties of我需要注册 TCollection 和 TCollectionItem 类,但由于
{TCollection}
property Items [Index: Integer]: TCollectionItem
{TCollectionItem}
property Collection: TCollection
сonstantly raises the exception of the impossibility to find TCollectionItem/TCollectionItem type. с不断引发无法找到 TCollectionItem/TCollectionItem 类型的异常。
如果你对你自己的代码内注册类,你可以先注册TCollectionItem
没有property Collection: TCollection
,然后注册TCollection
与property Items [Index: Integer]: TCollectionItem
事后添加的property Collection: TCollection
您TCollectionItem
。
You can use:您可以使用:
type
TCollection = class;
TCollectionItem = class
published
property Items: TCollection;
end;
TCollection = class
published
property Items [Index: Integer]: TCollectionItem;
end;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.