home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 September
/
Chip_2002-09_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
XMLCOMP.ZIP
/
test
/
model
/
DnAddress.pas
next >
Wrap
Pascal/Delphi Source File
|
2002-06-16
|
1KB
|
58 lines
unit DnAddress;
interface
uses
Classes, DnCountry;
type
TAddress = class(TComponent)
private
FCity: string;
FNumber: string;
FZipcode: string;
FStreet: string;
FState: string;
FCountry: TCountry;
procedure SetCountry(const Value: TCountry);
public
procedure Notification(aComponent: TComponent; aOperation: TOperation); override;
published
property Street: string read FStreet write FStreet;
property Number: string read FNumber write FNumber;
property Zipcode: string read FZipcode write FZipcode;
property City: string read FCity write FCity;
property State: string read FState write FState;
property Country: TCountry read FCountry write SetCountry;
end;
implementation
{ TAddress }
procedure TAddress.Notification(aComponent: TComponent;
aOperation: TOperation);
begin
inherited;
if aOperation = opRemove then
begin
if aComponent = FCountry then
FCountry := nil;
end;
end;
procedure TAddress.SetCountry(const Value: TCountry);
begin
FCountry := Value;
if FCountry <> nil then
FCountry.FreeNotification(Self);
end;
initialization
RegisterClasses([TAddress]);
finalization
UnregisterClasses([TAddress]);
end.