Changeset 561 for PersistentData/Backend/UPDClientMemory.pas
- Timestamp:
- Sep 10, 2022, 6:26:39 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PersistentData/Backend/UPDClientMemory.pas
r387 r561 1 1 unit UPDClientMemory; 2 3 {$mode Delphi}{$H+}4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UPDClient, SpecializedList;6 Classes, SysUtils, UPDClient, Generics.Collections; 9 7 10 8 type … … 21 19 function SearchObject(Id: Integer): TObjectProxy; 22 20 public 23 Objects: T ListObject;21 Objects: TObjectProxies; 24 22 procedure ObjectLoad(AObject: TObjectProxy); override; 25 23 procedure ObjectSave(AObject: TObjectProxy); override; … … 40 38 resourcestring 41 39 SObjectNotFound = 'Object with id %s not found'; 40 42 41 43 42 implementation … … 97 96 else begin 98 97 AObject.Id := GetNewObjectId; 99 Obj := TObjectProxy(Objects.AddNew(TObjectProxy.Create));98 Obj := Objects.AddProxy; 100 99 Obj.Assign(AObject); 101 100 end; … … 119 118 NewObject: TObjectProxy; 120 119 Table: string; 120 Item: TPair<string, string>; 121 121 begin 122 122 AList.Objects.Clear; … … 132 132 133 133 if AList.ColummsFilterUse then begin 134 for P := 0 to Properties.Count - 1do135 if AList.ColumnsFilter.IndexOf( Properties.Keys[I]) <> -1 then136 NewObject.Properties.Add( Properties.Keys[I], Properties[I].Value);134 for Item in Properties do 135 if AList.ColumnsFilter.IndexOf(Item.Key) <> -1 then 136 NewObject.Properties.Add(Item.Key, Item.Value); 137 137 end else NewObject.Properties.Assign(Properties); 138 138 end; … … 147 147 procedure TPDClientMemory.ListSave(AList: TListProxy); 148 148 begin 149 150 149 end; 151 150 152 151 procedure TPDClientMemory.TypeDefine(AType: TPDType); 153 152 begin 154 155 153 end; 156 154 157 155 procedure TPDClientMemory.TypeUndefine(AType: TPDType); 158 156 begin 159 160 157 end; 161 158 162 159 function TPDClientMemory.TypeIsDefined(AType: TPDType): Boolean; 163 160 begin 164 161 Result := False; 165 162 end; 166 163 167 164 procedure TPDClientMemory.Install; 168 165 begin 169 170 166 end; 171 167 172 168 procedure TPDClientMemory.Uninstall; 173 169 begin 174 175 170 end; 176 171 … … 178 173 begin 179 174 inherited; 180 Objects := T ListObject.Create;175 Objects := TObjectProxies.Create; 181 176 BackendName := 'Memory'; 182 177 end; … … 184 179 destructor TPDClientMemory.Destroy; 185 180 begin 186 Objects.Free;187 inherited Destroy;181 FreeAndNil(Objects); 182 inherited; 188 183 end; 189 184 190 185 procedure TPDClientMemory.Connect; 191 186 begin 192 inherited Connect;187 inherited; 193 188 end; 194 189 195 190 procedure TPDClientMemory.Disconnect; 196 191 begin 197 inherited Disconnect;192 inherited; 198 193 end; 199 194
Note:
See TracChangeset
for help on using the changeset viewer.