home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / delphi / kolekce / d56 / XMLCOMP.ZIP / test / model / DnCountry.pas < prev    next >
Pascal/Delphi Source File  |  2002-06-16  |  719b  |  40 lines

  1. unit DnCountry;
  2.  
  3. interface
  4.  
  5. uses
  6.   Classes, Contnrs;
  7.  
  8. type
  9.   TCountry = class(TComponent)
  10.   private
  11.     FCountryName: string;
  12.   published
  13.     property CountryName: string read FCountryName write FCountryName;
  14.   end;
  15.  
  16.   TCountryList = class(TComponentList)
  17.   private
  18.     function GetCountry(aIndex: Integer): TCountry;
  19.   public
  20.     property Country[aIndex: Integer]: TCountry read GetCountry;
  21.   end;
  22.  
  23. implementation
  24.  
  25. { TCountryList }
  26.  
  27. function TCountryList.GetCountry(aIndex: Integer): TCountry;
  28. begin
  29.   Assert(Items[aIndex] is TCountry);
  30.   result := TCountry(Items[aIndex]);
  31. end;
  32.  
  33. initialization
  34.   RegisterClasses([TCountry]);
  35.  
  36. finalization
  37.   UnregisterClasses([TCountry]);
  38.  
  39. end.
  40.