Changeset 120 for trunk/UContact.pas
- Timestamp:
- Feb 19, 2022, 12:09:21 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UContact.pas
r119 r120 229 229 procedure SaveToFile(FileName: string); override; 230 230 procedure LoadFromFile(FileName: string); override; 231 procedure Sort; 232 procedure Assign(Source: TContactsFile); 231 233 constructor Create; override; 232 234 destructor Destroy; override; … … 1870 1872 end; 1871 1873 1874 function CompareContactFullName(const Item1, Item2: TContact): Integer; 1875 begin 1876 Result := CompareStr(Item1.Fields[cfFullName], Item2.Fields[cfFullName]); 1877 end; 1878 1879 function ComparePropertyName(const Item1, Item2: TContactProperty): Integer; 1880 begin 1881 Result := CompareStr(Item1.Name + ';' + Item1.Attributes.Text, 1882 Item2.Name + ';' + Item2.Attributes.Text); 1883 end; 1884 1885 procedure TContactsFile.Sort; 1886 var 1887 I: Integer; 1888 begin 1889 Contacts.Sort(CompareContactFullName); 1890 for I := 0 to Contacts.Count - 1 do 1891 Contacts[I].Properties.Sort(ComparePropertyName); 1892 end; 1893 1894 procedure TContactsFile.Assign(Source: TContactsFile); 1895 begin 1896 inherited Assign(Source); 1897 Contacts.Assign(Source.Contacts); 1898 end; 1899 1872 1900 constructor TContactsFile.Create; 1873 1901 begin
Note:
See TracChangeset
for help on using the changeset viewer.