Changeset 58 for trunk


Ignore:
Timestamp:
Nov 16, 2012, 9:05:08 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Application divided to separate package ChronisPlatform and test application which use this package and define test module.
Location:
trunk
Files:
16 added
6 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r56 r58  
    3636  end;
    3737
     38  { TChronisPlatform }
     39
     40  TChronisPlatform = class(TComponent)
     41  public
     42    constructor Create(AOwner: TComponent); override;
     43    destructor Destroy; override;
     44    procedure Init;
     45    procedure Done;
     46  end;
     47
     48procedure Register;
     49
    3850var
    3951  Core: TCore;
     
    4456
    4557uses
    46   URegistredModules, UFormMain;
     58  UFormMain, UFormConnection;
     59
     60procedure Register;
     61begin
     62  RegisterComponents('Chronis', [TChronisPlatform]);
     63end;
     64
     65{ TChronisPlatform }
     66
     67constructor TChronisPlatform.Create(AOwner: TComponent);
     68begin
     69  inherited Create(AOwner);
     70end;
     71
     72destructor TChronisPlatform.Destroy;
     73begin
     74  inherited Destroy;
     75end;
     76
     77procedure TChronisPlatform.Init;
     78begin
     79  Application.CreateForm(TCore, Core);
     80  Application.CreateForm(TFormMain, FormMain);
     81  Application.CreateForm(TFormConnection, FormConnection);
     82  //Core := TCore.Create(Application);
     83  //FormMain := TFormMain.Create(Application);
     84  //FormConnection := TFormConnection.Create(Application);
     85end;
     86
     87procedure TChronisPlatform.Done;
     88begin
     89  FormConnection.Free;
     90  FormMain.Free;
     91  Core.Free;
     92end;
    4793
    4894
     
    80126    try
    81127      Context := RegistryContext;
    82       RegisterModules(ModuleManager);
     128      //RegisterModules(ModuleManager);
    83129      if ReadBoolWithDefault('ModuleManagerInstalled', False) then
    84130        ModuleManager.LoadFromRegistry(RegContext(RegistryContext.RootKey, RegistryContext.Key + '\Modules'))
     
    105151  if Assigned(FormModuleList) then FreeAndNil(FormModuleList);
    106152  ModuleManager.OnUpdate := nil;
    107   UnregisterModules(ModuleManager);
     153  //UnregisterModules(ModuleManager);
    108154end;
    109155
Note: See TracChangeset for help on using the changeset viewer.