Changeset 142 for trunk/Packages/PersistentData/UPDClient.pas
- Timestamp:
- Sep 10, 2022, 6:24:58 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/PersistentData/UPDClient.pas
r138 r142 31 31 destructor Destroy; override; 32 32 procedure Assign(Source: TObjectProxy); 33 end; 34 35 { TObjectProxies } 36 37 TObjectProxies = class(TObjectList<TObjectProxy>) 38 function AddProxy: TObjectProxy; 33 39 end; 34 40 … … 72 78 end; 73 79 74 { TPDTypePropert yList}75 76 TPDTypePropert yList= class(TObjectList<TPDTypeProperty>)80 { TPDTypeProperties } 81 82 TPDTypeProperties = class(TObjectList<TPDTypeProperty>) 77 83 Client: TPDClient; 78 procedureAddSimple(Name: string; TypeName: string; Unique: Boolean = False;79 Index: Boolean = False) ;84 function AddSimple(Name: string; TypeName: string; Unique: Boolean = False; 85 Index: Boolean = False): TPDTypeProperty; 80 86 end; 81 87 … … 89 95 Name: string; 90 96 DbType: string; 91 Properties: TPDTypePropert yList;97 Properties: TPDTypeProperties; 92 98 function IsDefined: Boolean; 93 99 procedure Define; … … 98 104 end; 99 105 100 { TPDType List}101 102 TPDType List= class(TObjectList<TPDType>)106 { TPDTypes } 107 108 TPDTypes = class(TObjectList<TPDType>) 103 109 Client: TPDClient; 104 110 function AddType(Name: string; DbType: string = ''): TPDType; … … 119 125 procedure SetConnectionString(AValue: string); virtual; 120 126 public 121 Types: TPDType List;127 Types: TPDTypes; 122 128 Version: string; 123 129 BackendName: string; … … 156 162 implementation 157 163 158 { TPDTypePropertyList } 159 160 procedure TPDTypePropertyList.AddSimple(Name: string; TypeName: string; 161 Unique: Boolean = False; Index: Boolean = False); 162 var 163 NewProperty: TPDTypeProperty; 164 begin 165 NewProperty := TPDTypeProperty(Add(TPDTypeProperty.Create)); 166 NewProperty.Name := Name; 167 NewProperty.DbType := Client.Types.SearchByName(TypeName); 168 NewProperty.Unique := Unique; 169 NewProperty.Index := Index; 170 end; 171 172 173 { TPDTypeList } 174 175 function TPDTypeList.AddType(Name: string; DbType: string = ''): TPDType; 176 begin 177 Result := TPDType(Add(TPDType.Create)); 164 { TObjectProxies } 165 166 function TObjectProxies.AddProxy: TObjectProxy; 167 begin 168 Result := TObjectProxy.Create; 169 Add(Result); 170 end; 171 172 { TPDTypeProperties } 173 174 function TPDTypeProperties.AddSimple(Name: string; TypeName: string; 175 Unique: Boolean = False; Index: Boolean = False): TPDTypeProperty; 176 begin 177 Result := TPDTypeProperty.Create; 178 Result.Name := Name; 179 Result.DbType := Client.Types.SearchByName(TypeName); 180 Result.Unique := Unique; 181 Result.Index := Index; 182 Add(Result); 183 end; 184 185 { TPDTypes } 186 187 function TPDTypes.AddType(Name: string; DbType: string = ''): TPDType; 188 begin 189 Result := TPDType.Create; 178 190 Result.Client := Client; 179 191 Result.Name := Name; 180 192 Result.DbType := DbType; 181 end; 182 183 function TPDTypeList.SearchByName(Name: string): TPDType; 193 Add(Result); 194 end; 195 196 function TPDTypes.SearchByName(Name: string): TPDType; 184 197 var 185 198 I: Integer; … … 218 231 constructor TPDType.Create; 219 232 begin 220 Properties := TPDTypePropert yList.Create;233 Properties := TPDTypeProperties.Create; 221 234 end; 222 235 223 236 destructor TPDType.Destroy; 224 237 begin 225 Properties.Free;238 FreeAndNil(Properties); 226 239 inherited; 227 240 end; … … 254 267 destructor TObjectProxy.Destroy; 255 268 begin 256 Properties.Free;269 FreeAndNil(Properties); 257 270 inherited; 258 271 end; … … 285 298 destructor TListProxy.Destroy; 286 299 begin 287 Objects.Free;288 ColumnsFilter.Free;300 FreeAndNil(Objects); 301 FreeAndNil(ColumnsFilter); 289 302 inherited; 290 303 end; … … 311 324 procedure TPDClient.SetConnectionString(AValue: string); 312 325 begin 313 314 326 end; 315 327 … … 413 425 begin 414 426 inherited; 415 Types := TPDType List.Create;427 Types := TPDTypes.Create; 416 428 Types.Client := Self; 417 429 InitSystemTypes; … … 420 432 destructor TPDClient.Destroy; 421 433 begin 422 Types.Free;434 FreeAndNil(Types); 423 435 inherited; 424 436 end; … … 434 446 procedure TPDClient.Install; 435 447 begin 436 437 448 end; 438 449 … … 444 455 procedure TPDClient.Update; 445 456 begin 446 447 457 end; 448 458
Note:
See TracChangeset
for help on using the changeset viewer.