Changeset 432 for Common/URegistry.pas


Ignore:
Timestamp:
Oct 25, 2012, 2:11:47 PM (12 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/URegistry.pas

    r404 r432  
    2626  TRegistryEx = class(TRegistry)
    2727  private
     28    function GetContext: TRegistryContext;
     29    procedure SetContext(AValue: TRegistryContext);
    2830  public
    2931    function ReadBoolWithDefault(const Name: string;
     
    3537    function DeleteKeyRecursive(const Key: string): Boolean;
    3638    function OpenKey(const Key: string; CanCreate: Boolean): Boolean;
     39    property Context: TRegistryContext read GetContext write SetContext;
    3740  end;
    3841
     
    106109end;
    107110
     111function TRegistryEx.GetContext: TRegistryContext;
     112begin
     113  Result.Key := CurrentPath;
     114  Result.RootKey := RootKey;
     115end;
     116
     117procedure TRegistryEx.SetContext(AValue: TRegistryContext);
     118begin
     119  RootKey := AValue.RootKey;
     120  OpenKey(AValue.Key, True);
     121end;
     122
    108123function TRegistryEx.ReadBoolWithDefault(const Name: string;
    109124  DefaultValue: Boolean): Boolean;
Note: See TracChangeset for help on using the changeset viewer.