home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 September
/
Chip_2002-09_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
XMLCOMP.ZIP
/
test
/
model
/
DnTestModel.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2002-06-16
|
957b
|
48 lines
unit DnTestModel;
interface
uses
Classes, DnPerson, DnCountry;
type
TDnTestModel = class(TComponent)
private
FCountries: TCountryList;
FPersons: TPersonList;
public
constructor Create(aOwner: TComponent); override;
destructor Destroy; override;
function AddCountry(aCountryName: string): TCountry;
published
property Persons: TPersonList read FPersons;
property Countries: TCountryList read FCountries;
end;
implementation
{ TDnTestModel }
function TDnTestModel.AddCountry(aCountryName: string): TCountry;
begin
result := TCountry.Create(Self);
result.CountryName := aCountryName;
Countries.Add(result);
end;
constructor TDnTestModel.Create(aOwner: TComponent);
begin
inherited;
FCountries := TCountryList.Create;
FPersons := TPersonList.Create;
end;
destructor TDnTestModel.Destroy;
begin
FCountries.Free;
FPersons.Free;
inherited;
end;
end.