* Introduce reload method

git-svn-id: trunk@30260 -
This commit is contained in:
michael 2015-03-19 15:09:27 +00:00
parent 1ea195aefe
commit 636fb64577

View File

@ -73,6 +73,7 @@ type
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
Procedure Reload;
procedure Clear; procedure Clear;
procedure Flush; // Writes the JSON file procedure Flush; // Writes the JSON file
procedure OpenKey(const aPath: WideString; AllowCreate : Boolean); procedure OpenKey(const aPath: WideString; AllowCreate : Boolean);
@ -528,11 +529,16 @@ begin
DeletePath(APath); DeletePath(APath);
end; end;
Procedure TJSONConfig.Reload;
begin
if Length(Filename) > 0 then
DoSetFilename(Filename,True);
end;
procedure TJSONConfig.Loaded; procedure TJSONConfig.Loaded;
begin begin
inherited Loaded; inherited Loaded;
if Length(Filename) > 0 then Reload;
DoSetFilename(Filename,True);
end; end;
function TJSONConfig.FindPath(const APath: WideString; AllowCreate: Boolean function TJSONConfig.FindPath(const APath: WideString; AllowCreate: Boolean