Changeset 77 for trunk/UContact.pas
- Timestamp:
- Dec 15, 2021, 9:03:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UContact.pas
r76 r77 119 119 TContact = class 120 120 private 121 FModified: Boolean; 122 FOnModify: TNotifyEvent; 121 123 function GetField(Index: TContactFieldIndex): string; 122 124 procedure SetField(Index: TContactFieldIndex; AValue: string); 125 procedure SetModified(AValue: Boolean); 126 procedure DoOnModify; 123 127 public 124 128 Properties: TContactProperties; … … 137 141 procedure LoadFromFile(FileName: string); 138 142 property Fields[Index: TContactFieldIndex]: string read GetField write SetField; 139 end; 143 property Modified: Boolean read FModified write SetModified; 144 property OnModify: TNotifyEvent read FOnModify write FOnModify; 145 end; 146 147 TGetContactEvent = function (Contact: TContact): TContact of object; 140 148 141 149 { TContacts } … … 850 858 end; 851 859 end; 860 Modified := True; 852 861 end else raise Exception.Create(SFieldIndexNotDefined); 862 end; 863 864 procedure TContact.SetModified(AValue: Boolean); 865 begin 866 if FModified = AValue then Exit; 867 FModified := AValue; 868 DoOnModify; 869 end; 870 871 procedure TContact.DoOnModify; 872 begin 873 if Assigned(FOnModify) then FOnModify(Self); 853 874 end; 854 875 … … 903 924 begin 904 925 Properties.Assign(Source.Properties); 926 FModified := Source.FModified; 905 927 end; 906 928
Note:
See TracChangeset
for help on using the changeset viewer.