Ignore:
Timestamp:
Apr 3, 2012, 7:28:01 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Code related to persistence layer abstraction moved to separated package PersistentData.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Client/USystem.pas

    r51 r52  
    77uses
    88  Classes, SysUtils, SpecializedList, SpecializedDictionary, USqlDatabase,
    9   Strings, UDataTypes, Dialogs, ComCtrls, StdCtrls, Controls, UChronisClient,
     9  Strings, UDataTypes, Dialogs, ComCtrls, StdCtrls, Controls, UPDClient,
    1010  UChronisModule;
    1111
     
    9393    Base: TChronisBase;
    9494    procedure UpdateList;
     95    function IsInstalled: Boolean;
    9596    procedure Install;
    9697    procedure Uninstall;
     
    104105    procedure SetActive(AValue: Boolean);
    105106  public
    106     Types: TChronisTypeList;
    107     Client: TChronisClient;
     107    Types: TPDTypeList;
     108    Client: TPDClient;
    108109    Modules: TChronisModuleList;
    109110    ModuleSystem: TChronisModule;
     
    635636    Types.Clear;
    636637    for I := 0 to Proxy.Objects.Count - 1 do begin
    637       with TChronisType(Types.AddNew(TChronisType.Create)) do
     638      with TPDType(Types.AddNew(TPDType.Create)) do
    638639      with TObjectProxy(Proxy.Objects[I]) do begin
    639640        Id := StrToInt(Properties.Values['Id']);
     
    667668constructor TChronisBase.Create;
    668669begin
    669   Types := TChronisTypeList.Create;
     670  Types := TPDTypeList.Create;
    670671  Modules := TChronisModuleList.Create;
    671672  Modules.Base := Self;
     
    781782end;
    782783
     784function TChronisModuleList.IsInstalled: Boolean;
     785var
     786  NewType: TPDType;
     787begin
     788  with TPDType.Create do
     789  try
     790    Client := Base.Client;
     791    Name := SystemModuleObject;
     792    Result := IsDefined;
     793  finally
     794    Free;
     795  end;
     796end;
     797
    783798procedure TChronisModuleList.Install;
    784799var
    785   NewType: TChronisType;
    786 begin
    787   NewType := TChronisType.Create;
    788   NewType.Client := Base.Client;
    789   NewType.Name := SystemModuleObject;
    790   NewType.Properties.Add('SysName', 'String');
    791   NewType.Properties.Add('Name', 'String');
    792   NewType.Properties.Add('Version', 'String');
    793   NewType.Properties.Add('License', 'String');
    794   NewType.Properties.Add('Creator', 'String');
    795   NewType.Properties.Add('HomePage', 'String');
    796   NewType.Properties.Add('Installed', 'Boolean');
    797   NewType.Define;
     800  NewType: TPDType;
     801begin
     802  with TPDType.Create do
     803  try
     804    Client := Base.Client;
     805    Name := SystemModuleObject;
     806    with Properties do begin
     807      Add('SysName', 'String');
     808      Add('Name', 'String');
     809      Add('Version', 'String');
     810      Add('License', 'String');
     811      Add('Creator', 'String');
     812      Add('HomePage', 'String');
     813      Add('Installed', 'Boolean');
     814    end;
     815    Define;
     816  finally
     817    Free;
     818  end;
    798819end;
    799820
    800821procedure TChronisModuleList.Uninstall;
    801822var
    802   NewType: TChronisType;
    803 begin
    804   NewType := TChronisType.Create;
    805   NewType.Client := Base.Client;
    806   NewType.Name := SystemModuleObject;
    807   NewType.Undefine;
     823  NewType: TPDType;
     824begin
     825  with TPDType.Create do
     826  try
     827    Client := Base.Client;
     828    Name := SystemModuleObject;
     829    Undefine;
     830  finally
     831    Free;
     832  end;
    808833end;
    809834
Note: See TracChangeset for help on using the changeset viewer.