Ignore:
Timestamp:
Sep 9, 2022, 8:20:25 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Removed TemplateGenerics package. Generics usage replaced by standard Generics.Collections.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/PersistentData/UPDClient.pas

    r137 r138  
    44
    55uses
    6   Classes, SysUtils, SpecializedList, SpecializedDictionary;
     6  Classes, SysUtils, Generics.Collections, UGenerics;
    77
    88const
     
    5757    ObjectName: string;
    5858    Path: string;
    59     Objects: TListObject; // TListObject<TObjectProxy>
     59    Objects: TObjectList<TObjectProxy>;
    6060    procedure Clear;
    6161    constructor Create;
     
    7474  { TPDTypePropertyList }
    7575
    76   TPDTypePropertyList = class(TListObject)
     76  TPDTypePropertyList = class(TObjectList<TPDTypeProperty>)
    7777    Client: TPDClient;
    7878    procedure AddSimple(Name: string; TypeName: string; Unique: Boolean = False;
     
    100100  { TPDTypeList }
    101101
    102   TPDTypeList = class(TListObject)
     102  TPDTypeList = class(TObjectList<TPDType>)
    103103    Client: TPDClient;
    104104    function AddType(Name: string; DbType: string = ''): TPDType;
     
    147147  TPDClientClass = class of TPDClient;
    148148
    149   resourcestring
    150     SClientNotSet = 'Client not set';
    151     SNotSupported = 'Not supported';
    152     SVersionMismatch = 'Version mismatch, client: %0:s, server: %1:s. Please upgrade database.';
    153     SCantLoadObjectWithoutId = 'Can''t load object without id';
     149resourcestring
     150  SClientNotSet = 'Client not set';
     151  SNotSupported = 'Not supported';
     152  SVersionMismatch = 'Version mismatch, client: %0:s, server: %1:s. Please upgrade database.';
     153  SCantLoadObjectWithoutId = 'Can''t load object without id';
    154154
    155155
     
    163163  NewProperty: TPDTypeProperty;
    164164begin
    165   NewProperty := TPDTypeProperty(AddNew(TPDTypeProperty.Create));
     165  NewProperty := TPDTypeProperty(Add(TPDTypeProperty.Create));
    166166  NewProperty.Name := Name;
    167167  NewProperty.DbType := Client.Types.SearchByName(TypeName);
     
    175175function TPDTypeList.AddType(Name: string; DbType: string = ''): TPDType;
    176176begin
    177   Result := TPDType(AddNew(TPDType.Create));
     177  Result := TPDType(Add(TPDType.Create));
    178178  Result.Client := Client;
    179179  Result.Name := Name;
     
    280280begin
    281281  ColumnsFilter := TListString.Create;
    282   Objects := TListObject.Create;
     282  Objects := TObjectList<TObjectProxy>.Create;
    283283end;
    284284
     
    345345    NewObject.Load;
    346346
    347     DbVersion := NewObject.Properties.Values['Version'];
     347    DbVersion := NewObject.Properties.Items['Version'];
    348348    if Version <> DbVersion then
    349349      raise Exception.Create(Format(SVersionMismatch, [Version, DbVersion]));
     
    395395    Tables.Count := NewProxy.Objects.Count;
    396396    for I := 0 to NewProxy.Objects.Count - 1 do
    397       Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties.Values['TABLE_NAME'];
     397      Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties.Items['TABLE_NAME'];
    398398
    399399    for I := 0 to Types.Count - 1 do
Note: See TracChangeset for help on using the changeset viewer.