AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Serialisieren eines Objektes unter D7

Ein Thema von Mr_G · begonnen am 13. Nov 2004 · letzter Beitrag vom 5. Dez 2004
 
Benutzerbild von Jens Schumann
Jens Schumann

Registriert seit: 27. Apr 2003
Ort: Bad Honnef
1.644 Beiträge
 
Delphi 2009 Professional
 
#23

Re: Serialisieren eines Objektes unter D7

  Alt 16. Nov 2004, 10:14
Hallo,
wenn ich mir die Zeichnung anschaue, dann vermute ich das Mr_G soetwas meint:

Delphi-Quellcode:
TSubCollection_1_Item = class(TCollectionItem) // wird von SubCollection_1 verwaltet !!!
...

TCollection_1 =class(TmxJsCollection)
private
  FSubCollection_1 : TmxJsCollection;
  FXYZ : Integer;
public
  property SubCollection_1 : TmxJsCollection read FSubCollection_1 write FSubCollection_1;
  property XYZ: Integer read FXYZ write FXYZ;
end;
Jetzt möchte Mr_G über SubCollection_1 auf XYZ Zugreifen.
SubCollection_1.Collection. weiter kommt Mr_G z.Z. noch nicht.
Jetzt würde ich für SubCollection_1 einen Nachfahren von TmxJsCollection basteln.
Diesem Nachfahren würde ich eine Parent Eigenschaft verpassen

Delphi-Quellcode:
TSubCollection_1_Item = class(TCollectionItem) // wird von SubCollection_1 verwaltet !!!
...

TCollection_1 =class;

TmxJsCollectionParent=class(TmxJsCollection)
private
  FParent : TCollection_1;
public
  property Parent : TCollection_1 read FParent write FParent;
end;

TCollection_1 =class(TmxJsCollection)
private
  FSubCollection_1 : TmxJsCollectionParent;
  FXYZ : Integer;
public
  constructor Create(ItemClass : TCollectionItemClass);
  property SubCollection_1 : TmxJsCollectionParent read FSubCollection_1 write FSubCollection_1;
  property XYZ: Integer read FXYZ write FXYZ;
end;

...
TCollection_1.constructor.Create(ItemClass : TCollectionItemClass);
begin
  inherited Create(ItemClass);
  FSubCollection_1:=TmxJsCollectionParent(TSubCollection_1_Item);
  FSubCollection.Parent:=Self; // Hier ist es !!!!!!!!
  ...
end;
Jetzt geht folgendes: TmxJsCollectionParent(TSubCollection_1_Item.Collection).Parent.XYZ (ungetested)
I come from outer space to save the human race
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz