CreateAsRegistry Method
Description
Sets the registry key to load/save the information to/from and it also determines if the information will be loaded or saved to the registry.
Syntax
Public Function CreateAsRegistry( _
ByVal Loading As Boolean, _
ByVal Section As String _
) As Boolean
Parameters
- Loading
Set to True to make the GetSection, ExchangeInt, and ExchangeString methods load data from a data source. The information loaded will come from the Section specified in the Section parameter.
Set to False to make the GetSection, ExchangeInt, and ExchangeString methods save data to a data source. The information saved will be stored under the Section specified in the Section parameter.
- Section
The name of a layout to load or save from/to a data source.
Return Type
Returns True if successful, False otherwise.
Remarks
There are three ways to save and load layout/state information to a PropExchange object. You can load and save information to the system registry, an XML file, or a binary file. The CreateAsBinary, CreateAsRegistry, and CreateAsXML methods are used to specify whether to save or load the layout/state information and the location of the layout/state information (path to XML or Bin file, Registry Key). Note that this does not actually load/save the information; it just indicates the location to load/save the information to/from and if it will be loaded/saved.
When using any of the CreateAs methods, the Loading parameter is used to specify whether the layout information is currently Loading or saving. The Loading property will be True until set to False by calling a CreateAs method and passing False as the Loading parameter. The Loading property can be used to determine if you are currently loading layout information.
The DoPropExchange method is used to actually load or save the information to a file or the registry.
When saving information, the Valid property should be used after a call to one of the CreateAs methods to verify that the layout information was correctly saved to the PropExchange object.
When loading information, the LoadFromFile method can be used to verify and load the information at the same time.
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.