Hallo maximov,
die einzige Lösung die mir gerade eingefallen ist wäre folgende:
Delphi-Quellcode:
TAddressDummy = class(TComponent)
private
FItems : TAddressItems;
FCollectionname : String;
public
published
property Items : TAddressItems read FItems write FItems;
property Collectionname : String read FCollectionname write FCollectionname;
end;
procedure TAddressItems.SaveToStream(Stream: TStream);
var
AddressDummy : TAddressDummy;
begin
AddressDummy:=TAddressDummy.Create(Nil);
Try
AddressDummy.Items:=Self;
AddressDummy.Collectionname:=FCollectionname;
Stream.WriteComponent(AddressDummy);
Finally
AddressDummy.Free;
end;
end;
procedure TAddressItems.LoadFromStream(Stream: TStream);
var
AddressDummy : TAddressDummy;
begin
AddressDummy:=TAddressDummy.Create(Nil);
Try
AddressDummy.Items:=Self;
Stream.ReadComponent(AddressDummy);
FCollectionname:=AddressDummy.Collectionname;
Finally
AddressDummy.Free;
end;
end;
Aber dem Dummy ebenfalls eine Collectionname property zu spendieren finde ich irgendwie doof.