AGB  ·  Datenschutz  ·  Impressum  







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

Rätselhaftes Konstrukt in Unit Dialogs

Ein Thema von idefix2 · begonnen am 29. Jan 2012 · letzter Beitrag vom 31. Jan 2012
 
daywalker9

Registriert seit: 1. Jan 2010
Ort: Leer
594 Beiträge
 
Delphi XE3 Professional
 
#11

AW: Rätselhaftes Konstrukt in Unit Dialogs

  Alt 30. Jan 2012, 08:53
Zum beispiel sowas:

Delphi-Quellcode:
type
  ListAttribute = class(TCustomAttribute)
  private
    FTagName: String;
    FClass: TClass;
  public
    constructor Create(const ATagName: String; AClassType: TClass);
   end;


type
  TMyClass = class
    [ ListAttribute('SubPositions', TPositionInformation) ]
    property SubPositions : TObjectList<TPositionInformation> read FSubPositions write FSubPositions;
    [ ListAttribute('DatabaseVersions', TDatabaseVersion) ]
    property DatabaseVersions : TObjectList<TDatabaseVersion> read FDatabaseVersions write FDatabaseVersions;
    [ ListAttribute('ProductionUnits', TProductionUnit) ]
    property ProductionUnits : TObjectList<TProductionUnit> read FProductionUnits write FProductionUnits;
    [ ListAttribute('Segments', TPositionSegment) ]
    property Segments : TObjectList<TPositionSegment> read fSegments write FSegments;
   end;
Passend dafür gibts einen Serializer der auf der neuen RTTI aufbaut und wenn ich eine Liste habe, weiß ich durch das Attribute, wie der Knoten in der XML heißt und welche Klasse ich dafür erzeugen muss.
Lars
  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 06:31 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