Ignore:
Timestamp:
Apr 9, 2022, 12:13:45 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Contact image unit moved into VCard package.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/VCard/UContactImage.pas

    r130 r131  
    1111  { TContactImage }
    1212
    13   TContactImage = class
     13  TContactImage = class(TComponent)
    1414  private
    1515    FOnChange: TNotifyEvent;
     
    3636    procedure LoadFromFile(FileName: string);
    3737    procedure SaveToFile(FileName: string);
    38     procedure Assign(Source: TContactImage);
    39     constructor Create;
     38    procedure Assign(Source: TPersistent); override;
     39    constructor Create(AOwner: TComponent); override;
    4040    destructor Destroy; override;
     41  published
    4142    property Url: string read FUrl write SetUrl;
    4243    property Used: Boolean read FUsed write SetUsed;
     
    4445  end;
    4546
     47procedure Register;
     48
    4649
    4750implementation
    4851
     52procedure Register;
     53begin
     54  RegisterComponents('VCard', [TVCard]);
     55end;
    4956
    5057{ TContactImage }
     
    349356end;
    350357
    351 procedure TContactImage.Assign(Source: TContactImage);
    352 begin
    353   Bitmap.Assign(Source.Bitmap);
    354   Url := Source.Url;
    355   Loaded := Source.Loaded;
    356   Modified := Source.Modified;
    357   Format := Source.Format;
    358   FieldIndex := Source.FieldIndex;
    359   Contact := Source.Contact;
    360   Used := Source.Used;
    361 end;
    362 
    363 constructor TContactImage.Create;
    364 begin
     358procedure TContactImage.Assign(Source: TPersistent);
     359var
     360  SourceImage: TContactImage;
     361begin
     362  inherited;
     363  if Source is TContactImage then begin
     364    SourceImage := Source as TContactImage;
     365    Bitmap.Assign(SourceImage.Bitmap);
     366    Url := SourceImage.Url;
     367    Loaded := SourceImage.Loaded;
     368    Modified := SourceImage.Modified;
     369    Format := SourceImage.Format;
     370    FieldIndex := SourceImage.FieldIndex;
     371    Contact := SourceImage.Contact;
     372    Used := SourceImage.Used;
     373  end;
     374end;
     375
     376constructor TContactImage.Create(AOwner: TComponent);
     377begin
     378  inherited;
    365379  Bitmap := TBitmap.Create;
    366380end;
     
    372386end;
    373387
    374 
    375388end.
    376389
Note: See TracChangeset for help on using the changeset viewer.