StoredValues of property storage now works from Michael VC

git-svn-id: trunk@5811 -
This commit is contained in:
mattias 2004-08-17 19:41:10 +00:00
parent 43c69b43f3
commit 341ac9b2d1
3 changed files with 9 additions and 0 deletions

View File

@ -59,6 +59,7 @@ Type
TIniPropStorage = class(TCustomIniPropStorage)
Published
Property StoredValues;
property IniFileName;
property IniSection;
property Active;

View File

@ -358,6 +358,8 @@ end;
constructor TStoredValues.Create(AOwner: TPersistent);
begin
inherited Create(AOwner, TStoredValue);
If AOwner is TCustomPropertyStorage then
FStorage:=TCustomPropertyStorage(AOwner);
end;
function TStoredValues.IndexOf(const AName: string): Integer;
@ -448,11 +450,14 @@ begin
inherited Create(AOwner);
FActive := True;
FLinks := TList.Create;
FStoredValues:=TStoredValues.Create(Self);
FStoredValues.Storage:=Self;
end;
destructor TCustomPropertyStorage.Destroy;
begin
FreeStorage;
FStoredValues.Free;
while FLinks.Count > 0 do
RemoveLink(TPropertyStorageLink(FLinks.Last));
FreeAndNil(FLinks);
@ -521,6 +526,7 @@ begin
StorageNeeded(False);
Try
SaveProperties;
FStoredValues.SaveVAlues;
NotifyLinks(poSave);
if Assigned(FOnSaveProperties) then
FOnSaveProperties(Self);
@ -536,6 +542,7 @@ begin
if Active then begin
FSaved := False;
StorageNeeded(True);
FStoredValues.RestoreValues;
RestoreProperties;
NotifyLinks(poRestore);
FRestored:=True;

View File

@ -60,6 +60,7 @@ type
TXMLPropStorage = class(TCustomXMLPropStorage)
Published
property StoredValues;
property FileName;
property RootNodePath;
property Active;