PrevNext
EhLib
User's guide

 Using TPropStorageEh and TPropStorageManagerEh components

TPropStorageEh and TPropStorageManagerEh componetns realize technology to store components properties to/from settings storage such as ini files, registry etc.

Current version supports components to store/restore in/from ini files and registry.
Base component of the given technology is the TPropStorageEh. Place this component on the form, component properties of which you want to save in the storage. Double click on the component at design-time to open properties storage editor window. In the tree of properties you can select required properties for storing. Properties list is a list of all published properties or declared in DefineProperty function of components with the exclusion of properties of TCollection class. Further to the list of all elements of the collection, the tree of properties will contain <ForAllItems> subproperty, when you select subproperty in the given branch, the component will save corresponding subproperty for each element of the collection.

Component TPropStorageEh can save/restore property values in the stream, however for redirect flow in the storage necessary to execute one of the following actions.

1. Place component that inherited from TPropStorageManagerEh on the form.
In this version there are present two such components, this is TIniPropStorageManEh and TRegPropStorageManEh.
Set properties of these component and assign TPropStorageEh.StorageManager property to this component.

2. Or you can once write a code to register the global component - DefaultPropStorageManager. All TPropStorageEh components in which StorageManager property is not assigned will use DefaultPropStorageManager manager for redirecting flow of the property values to the storage.

Code to register the global component can look like this:

----------- MainUnit.Pas--------
......

var
  IniPropStorageMan: TIniPropStorageManEh;

initialization

  IniPropStorageMan := TIniPropStorageManEh.Create(nil);
  IniPropStorageMan.IniFileName := 'MyIniFile.Ini';
  SetDefaultPropStorageManager(IniPropStorageMan);
end.
--------------------------------

EhLib Team
E-mail: support@ehlib.com