Changeset 402 for Common


Ignore:
Timestamp:
Aug 9, 2012, 9:46:09 AM (12 years ago)
Author:
chronos
Message:
  • Modified: Used single TRegistryContext parameter in TLastOpenedList class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/ULastOpenedList.pas

    r393 r402  
    2323    destructor Destroy; override;
    2424    procedure LoadToMenuItem(MenuItem: TMenuItem; ClickAction: TNotifyEvent);
    25     procedure LoadFromRegistry(Root: HKEY; Key: string);
    26     procedure SaveToRegistry(Root: HKEY; Key: string);
     25    procedure LoadFromRegistry(Context: TRegistryContext);
     26    procedure SaveToRegistry(Context: TRegistryContext);
    2727    procedure AddItem(FileName: string);
    2828  published
     
    8787end;
    8888
    89 procedure TLastOpenedList.LoadFromRegistry(Root: HKEY; Key: string);
     89procedure TLastOpenedList.LoadFromRegistry(Context: TRegistryContext);
    9090var
    9191  I: Integer;
     
    9696  with Registry do
    9797  try
    98     RootKey := Root;
    99     OpenKey(Key, True);
     98    RootKey := Context.RootKey;
     99    OpenKey(Context.Key, True);
    100100    Items.Clear;
    101101    I := 0;
     
    112112end;
    113113
    114 procedure TLastOpenedList.SaveToRegistry(Root: HKEY; Key: string);
     114procedure TLastOpenedList.SaveToRegistry(Context: TRegistryContext);
    115115var
    116116  I: Integer;
     
    120120  with Registry do
    121121  try
    122     RootKey := Root;
    123     OpenKey(Key, True);
     122    RootKey := Context.RootKey;
     123    OpenKey(Context.Key, True);
    124124    for I := 0 to Items.Count - 1 do
    125125      WriteString('File' + IntToStr(I), UTF8Decode(Items[I]));
Note: See TracChangeset for help on using the changeset viewer.