source: trunk/Demo/URegistredModules.pas

Last change on this file was 59, checked in by chronos, 12 years ago
  • Fixed: Store module settings in system registry.
File size: 904 bytes
Line 
1unit URegistredModules;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, UModularSystem;
9
10procedure RegisterModules(ModuleManager: TModuleManager);
11procedure UnregisterModules(ModuleManager: TModuleManager);
12
13
14implementation
15
16uses
17 UModuleTest;
18
19procedure RegisterModules(ModuleManager: TModuleManager);
20begin
21 UnregisterModules(ModuleManager);
22 with ModuleManager do
23 try
24 Modules.BeginUpdate;
25 RegisterModule(TModuleTest.Create(nil));
26 finally
27 Modules.EndUpdate;
28 end;
29end;
30
31procedure UnregisterModules(ModuleManager: TModuleManager);
32var
33 I: Integer;
34 Module: TModule;
35begin
36 with ModuleManager do
37 try
38 Modules.BeginUpdate;
39 for I := Modules.Count - 1 downto 0 do begin
40 Module := TModule(Modules[I]);
41 UnregisterModule(Module);
42 Module.Free;
43 end;
44 finally
45 Modules.EndUpdate;
46 end;
47end;
48
49end.
50
Note: See TracBrowser for help on using the repository browser.