DXCore DecoupledStorage structure and settings file format
The DecoupledStorage object is used to handle storage for your DXCore plug-ins data. Usually, DecoupledStorage represents a single DXCore Options Page. If you are not going to create an Options Page, the DecoupledStorage will represent just named data storage.
The storage has three main identifiers (properties):
- Category (i.e. the path to the storage)
- Name (e.g. “MyPlugIn Settings”)
- Language (e.g. C#, C++, VisualBasic)
In case of Options Pages, the Name property is used to identify the Page, and the Category is intended to identify the path to your page. The path represents the part of the tree on the left of the Options Dialog. IDE tools have their own categories inside of the Dialog. You are able to put your Options Page into any of the existing categories, or create a new one, dedicated specially to your plug-ins.
If you are not going to create an Options Page, the Name property is used to identify the storage, and the Category property will identify an optional physical path to your storage relative to the global DXCore settings storage path.
Currently, DecoupledStorage is represented by a single file in the XML format. In case you don’t like XML format, you can implement your own decoupled storage object via the IStorageObject interface implementer. There is another storage implementer exists, which can store your settings in the INI files format.
Structurally, DecoupledStorage consists of the following elements:
Data (i.e. Options) is stored inside of Sections. These elements are accessible by name. Each Option element stores a single value of a specific type. The Language property of the DecoupledStorage determines which programming language this particular storage represents. Data for different languages is stored inside of a single storage. Folders are intended to represent complex, tree-like objects (e.g. see the Shortcuts options page). Each folder of the storage is stored in a separate file.
The settings file has hierarchical format to correspond to the structure of the DecoupledStorage:
Here is an example of such a file:
Settings file identifier is intended to distinguish DXCore storage files from other XML files and written as an XML comment. After the file identifier, the single Page element goes, which names the storage (or an Options Page). The name of the page is identical to the name of the file. The Page element may contain several or single Language elements, which contain Sections and Options by-turn.
That’s how the DecoupledStorage object is organized. It is not really necessary to understand, but it can be useful if you will use this object to persist your plug-in data.—– Products: DXCore Versions: 11.1 and up VS IDEs: any Updated: Aug/30/2011 ID: D049