Changeset 59 for trunk/Packages/ModularSystem/UModularSystem.pas
- Timestamp:
- Nov 16, 2012, 9:59:56 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/ModularSystem/UModularSystem.pas
r56 r59 109 109 FAPI: TAPI; 110 110 FOnUpdate: TNotifyEvent; 111 FUpdateCount: Integer;112 111 FOptions: TModuleManagerOptions; 113 112 procedure SetAPI(AValue: TAPI); … … 122 121 procedure RegisterModule(Module: TModule); 123 122 procedure UnregisterModule(Module: TModule); 124 procedure LoadFromRegistry( Context: TRegistryContext);125 procedure SaveToRegistry( Context: TRegistryContext);123 procedure LoadFromRegistry(AContext: TRegistryContext); 124 procedure SaveToRegistry(AContext: TRegistryContext); 126 125 constructor Create(AOwner: TComponent); override; 127 126 destructor Destroy; override; … … 139 138 resourcestring 140 139 SModuleNotFound = 'Module "%1:s" not found as dependency for module "%0:s"'; 140 SInvalidModuleName = 'Invalid module name'; 141 141 142 142 procedure Register; … … 264 264 procedure TModuleManager.RegisterModule(Module: TModule); 265 265 begin 266 if Module.Identification = '' then 267 raise Exception.Create(SInvalidModuleName); 266 268 Modules.Add(Module); 267 269 Module.FManager := Self; … … 291 293 end; 292 294 293 procedure TModuleManager.LoadFromRegistry( Context: TRegistryContext);295 procedure TModuleManager.LoadFromRegistry(AContext: TRegistryContext); 294 296 var 295 297 I: Integer; … … 297 299 with TRegistryEx.Create do 298 300 try 299 RootKey := Context.RootKey;301 RootKey := AContext.RootKey; 300 302 for I := 0 to Modules.Count - 1 do 301 303 with TModule(Modules[I]) do begin 302 OpenKey( Context.Key + '\' + Identification, True);304 OpenKey(AContext.Key + '\' + Identification, True); 303 305 Installed := ReadBoolWithDefault('Installed', Installed); 304 306 Enabled := ReadBoolWithDefault('Enabled', Enabled); … … 309 311 end; 310 312 311 procedure TModuleManager.SaveToRegistry( Context: TRegistryContext);313 procedure TModuleManager.SaveToRegistry(AContext: TRegistryContext); 312 314 var 313 315 I: Integer; … … 315 317 with TRegistryEx.Create do 316 318 try 317 RootKey := Context.RootKey;319 RootKey := AContext.RootKey; 318 320 for I := 0 to Modules.Count - 1 do 319 321 with TModule(Modules[I]) do begin 320 OpenKey( Context.Key + '\' + Identification, True);322 OpenKey(AContext.Key + '\' + Identification, True); 321 323 WriteBool('Enabled', Enabled); 322 324 WriteBool('Installed', Installed);
Note:
See TracChangeset
for help on using the changeset viewer.