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 | |
---|
1 | unit URegistredModules;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, UModularSystem;
|
---|
9 |
|
---|
10 | procedure RegisterModules(ModuleManager: TModuleManager);
|
---|
11 | procedure UnregisterModules(ModuleManager: TModuleManager);
|
---|
12 |
|
---|
13 |
|
---|
14 | implementation
|
---|
15 |
|
---|
16 | uses
|
---|
17 | UModuleTest;
|
---|
18 |
|
---|
19 | procedure RegisterModules(ModuleManager: TModuleManager);
|
---|
20 | begin
|
---|
21 | UnregisterModules(ModuleManager);
|
---|
22 | with ModuleManager do
|
---|
23 | try
|
---|
24 | Modules.BeginUpdate;
|
---|
25 | RegisterModule(TModuleTest.Create(nil));
|
---|
26 | finally
|
---|
27 | Modules.EndUpdate;
|
---|
28 | end;
|
---|
29 | end;
|
---|
30 |
|
---|
31 | procedure UnregisterModules(ModuleManager: TModuleManager);
|
---|
32 | var
|
---|
33 | I: Integer;
|
---|
34 | Module: TModule;
|
---|
35 | begin
|
---|
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;
|
---|
47 | end;
|
---|
48 |
|
---|
49 | end.
|
---|
50 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.