Home > Essentials > DXCore DecoupledStorage object for storing data

DXCore DecoupledStorage object for storing data

December 16th, 2010 Leave a comment Go to comments

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

ClearClears 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().
ClearAllClears 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.
CreateReturns an instance of the new DecoupledStorage with the specifed BasePath, Category and PageName properties.
DeletePhysically removes the storage from the system.
DeleteAllPhysically removes the storage and its folders from the system.
DeleteFolderPhysically removes the specified folder from the system.
DeleteKeyDeletes the specified key in the given section.
EraseSectionDeletes the specified section.
GetKeysReturns a string array of keys for the given section.
GetRootFoldersReturns a collection of the root folders.
GetSectionsReturns a string array of sections.
GetSubFoldersReturns a collection of subfolders inside the specified folder. Note that the value can be null if the folder contains subfolders without storage.
LoadSerializedLoads 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.
LoadSubFoldersLoads and initializes folders of this storage.
ReadBooleanReads a boolean value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadCharReads a char value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadColorReads a Color value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadDateTimeReads a DateTime value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadDoubleReads a Double value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadEnumReads a enumeration element value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadInt32Reads a System.Int32 value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadSingleReads a Single value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadStringReads a string value from the storage object. If the section or key was not found, this method returns the value passed in defaultValue.
ReadStringsReads a string array value from the storage object. If the section or key is not found, this method returns the value passed in defaultValue.
ReadXmlNodeReads a System.Xml.XmlNode value from the storage object. If the name was not found, this method returns null.
SaveSerializedSaves 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.
SetStorageObjectSets the IStorageObject implementer to be used for storing data in the particular format. Note that it is hidden from Intellisense.
UpdateStorageCommits changes to disk. If any language-specific storage object children have been created, that data is also committed to disk.
ValueExistsReturns true if a value exists at the given section and key.
WriteBooleanWrites a boolean value to the storage object.
WriteCharWrites a char value to the storage object.
WriteColorWrites a Color value to the storage object.
WriteDateTimeWrites a DateTime value to the storage object.
WriteDoubleWrites a Double value to the storage object.
WriteEnumWrites a enumeration value to the storage object.
WriteInt32Writes a Int32 value to the storage object.
WriteSingleWrites a Single value to the storage object.
WriteStorageDataWrites all pending data to the storage.
WriteStingWrites a string value to the storage object.
WriteStringsWrites a string array value to the storage object.
WriteXmlNodeWrites 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!
  1. December 17th, 2010 at 16:57 | #1