Changeset 59 for trunk/Packages/Common/URegistry.pas
- Timestamp:
- Dec 3, 2014, 9:09:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/URegistry.pas
r55 r59 17 17 rrKeyDynData = HKEY($80000006)); 18 18 19 { TRegistryContext } 20 19 21 TRegistryContext = record 20 22 RootKey: HKEY; 21 23 Key: string; 24 class operator Equal(A, B: TRegistryContext): Boolean; 22 25 end; 23 26 … … 26 29 TRegistryEx = class(TRegistry) 27 30 private 31 function GetCurrentContext: TRegistryContext; 32 procedure SetCurrentContext(AValue: TRegistryContext); 28 33 public 29 34 function ReadBoolWithDefault(const Name: string; … … 35 40 function DeleteKeyRecursive(const Key: string): Boolean; 36 41 function OpenKey(const Key: string; CanCreate: Boolean): Boolean; 42 property CurrentContext: TRegistryContext read GetCurrentContext write SetCurrentContext; 37 43 end; 38 44 … … 46 52 Result.RootKey := RootKey; 47 53 Result.Key := Key; 54 end; 55 56 { TRegistryContext } 57 58 class operator TRegistryContext.Equal(A, B: TRegistryContext): Boolean; 59 begin 60 Result := (A.Key = B.Key) and (A.RootKey = B.RootKey); 48 61 end; 49 62 … … 106 119 end; 107 120 121 function TRegistryEx.GetCurrentContext: TRegistryContext; 122 begin 123 Result.Key := CurrentPath; 124 Result.RootKey := RootKey; 125 end; 126 127 procedure TRegistryEx.SetCurrentContext(AValue: TRegistryContext); 128 begin 129 RootKey := AValue.RootKey; 130 OpenKey(AValue.Key, True); 131 end; 132 108 133 function TRegistryEx.ReadBoolWithDefault(const Name: string; 109 134 DefaultValue: Boolean): Boolean;
Note:
See TracChangeset
for help on using the changeset viewer.