Home > Essentials > DXCore DecoupledStorage object for storing data

DXCore DecoupledStorage object for storing data

December 16th, 2010

As the name says, the object handles decoupled storage for DXCore plug-ins. It is recommended for plug-in developers to use DecoupledStorage for persisting data (e.g. plug-in settings). The storage has its own structure and saved in a file of a specific format in the appropriate location.

Here are its methods:

Name

Description

Clear Clears the contents of the active language-specific storage object (set through the LanguageID property). If LanguageID is empty (“”), then the primary (language-neutral) storage object is cleared. To clear all storage objects, use ClearAll().
ClearAll Clears the contents of the storage object and any language-specific storage object children. To clear only the active storage object (set through the LanguageID property), use the Clear() method.
Create Returns an instance of the new DecoupledStorage with the specifed BasePath, Category and PageName properties.
Delete Physically removes the storage from the system.
DeleteAll Physically removes the storage and its folders from the system.
DeleteFolder Physically removes the specified folder from the system.
DeleteKey Deletes the specified key in the given section.
EraseSection Deletes the specified section.
GetKeys Returns a string array of keys for the given section.
GetRootFolders Returns a collection of the root folders.
GetSections Returns a string array of sections.
GetSubFolders Returns a collection of subfolders inside the specified folder. Note that the value can be null if the folder contains subfolders without storage.
LoadSerialized Loads a serializable object from the specified file name (which should be without a path). If this method is called when this storage object is in a language-specific state (e.g., LanguageID = “CSharp“), the actual file name will have the LanguageID inserted before the file extension (e.g., “HelloWorld.bin” becomes “HelloWorld.CSharp.bin“). If this storage object is in a language-neutral state (e.g., LanguageID = “”), then the file name is unchanged.
LoadSubFolders Loads and initializes folders of this storage.
ReadBoolean Reads a boolean value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadChar Reads a char value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadColor Reads a Color value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadDateTime Reads a DateTime value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadDouble Reads a Double value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadEnum Reads a enumeration element value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadInt32 Reads a System.Int32 value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadSingle Reads a Single value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadString Reads a string value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadStrings Reads a string array value from the storage object. If the section or key is not found, this method returns the value passed in defaultValue.
ReadXmlNode Reads a System.Xml.XmlNode value from the storage object. If the name was not found, this method returns null.
SaveSerialized Saves a serializable object to the specified file name (which should be without a path). If this method is called when this storage object is in a language-specific state (e.g., LanguageID = “CSharp“), the actual file name will have the LanguageID inserted before the file extension (e.g., “HelloWorld.bin” becomes “HelloWorld.CSharp.bin“). If this storage object is in a language-neutral state (e.g., LanguageID = “”), then the file name is unchanged.
SetStorageObject Sets the IStorageObject implementer to be used for storing data in the particular format. Note that it is hidden from Intellisense.
UpdateStorage Commits changes to disk. If any language-specific storage object children have been created, that data is also committed to disk.
ValueExists Returns true if a value exists at the given section and key.
WriteBoolean Writes a boolean value to the storage object.
WriteChar Writes a char value to the storage object.
WriteColor Writes a Color value to the storage object.
WriteDateTime Writes a DateTime value to the storage object.
WriteDouble Writes a Double value to the storage object.
WriteEnum Writes a enumeration value to the storage object.
WriteInt32 Writes a Int32 value to the storage object.
WriteSingle Writes a Single value to the storage object.
WriteStorageData Writes all pending data to the storage.
WriteSting Writes a string value to the storage object.
WriteStrings Writes a string array value to the storage object.
WriteXmlNode Writes a System.Xml.XmlNode value to the storage object.

See the “How to use DecoupledStorage to persist your settings” topic, to learn more on storage usage.

—–
Products: DXCore
Versions: 10.2 and up
VS IDEs: any
Updated: Jun/18/2011
ID: D048

Similar Posts:

  1. No comments yet. Be the first and leave a comment!