C# Class June.LocalStorage.Providers.XMLLocalStore

XML local storage.
Inheritance: ILocalStore
Datei anzeigen Open project: JuneSoftware/LocalStorage

Protected Properties

Property Type Description
FILE_PATH string
_XML_STORE XmlStore

Public Methods

Method Description
DeleteAll ( ) : void

Clears all data.

DeleteKey ( string key ) : void

Deletes the key.

GetFloat ( string key ) : float

Gets the float value for a key.

GetInt ( string key ) : int

Gets the int value for a key.

GetSerializedData ( ) : IDictionary,System.Collections.Generic

Gets the serialized data.

GetString ( string key ) : string

Gets the string value for a key.

HasKey ( string key ) : bool

Checks if the key exists.

Initialize ( ) : void

Initialize this instance. This is where the provider should write its initialization code. This could be called from the constructor as well. While creating an instance the LocalStorage class does not explicity call this Initialize method, but expects the provider to be initialized after calling the constructor. This method is only provided incase the game wants to re-initialize the provider for any reason.

Save ( ) : void

Saves currently modified data.

SetFloat ( string key, float value ) : void

Sets the float value for a key.

SetInt ( string key, int value ) : void

Sets the int value for a key.

SetString ( string key, string value ) : void

Sets the string value for a key.

XMLLocalStore ( ) : System

Initializes a new instance of the XMLLocalStorage class.

Protected Methods

Method Description
GetItemOrCreateDefault ( string key ) : XmlItem

Gets the item or create default.

ReadDataFromFile ( ) : void

Reads the data from file.

WriteDataToFile ( ) : void

Writes the data to file.

Method Details

DeleteAll() public method

Clears all data.
public DeleteAll ( ) : void
return void

DeleteKey() public method

Deletes the key.
public DeleteKey ( string key ) : void
key string Key.
return void

GetFloat() public method

Gets the float value for a key.
public GetFloat ( string key ) : float
key string Key.
return float

GetInt() public method

Gets the int value for a key.
public GetInt ( string key ) : int
key string Key.
return int

GetItemOrCreateDefault() protected method

Gets the item or create default.
protected GetItemOrCreateDefault ( string key ) : XmlItem
key string Key.
return XmlItem

GetSerializedData() public method

Gets the serialized data.
public GetSerializedData ( ) : IDictionary,System.Collections.Generic
return IDictionary,System.Collections.Generic

GetString() public method

Gets the string value for a key.
public GetString ( string key ) : string
key string Key.
return string

HasKey() public method

Checks if the key exists.
public HasKey ( string key ) : bool
key string Key.
return bool

Initialize() public method

Initialize this instance. This is where the provider should write its initialization code. This could be called from the constructor as well. While creating an instance the LocalStorage class does not explicity call this Initialize method, but expects the provider to be initialized after calling the constructor. This method is only provided incase the game wants to re-initialize the provider for any reason.
public Initialize ( ) : void
return void

ReadDataFromFile() protected method

Reads the data from file.
protected ReadDataFromFile ( ) : void
return void

Save() public method

Saves currently modified data.
public Save ( ) : void
return void

SetFloat() public method

Sets the float value for a key.
public SetFloat ( string key, float value ) : void
key string Key.
value float Value.
return void

SetInt() public method

Sets the int value for a key.
public SetInt ( string key, int value ) : void
key string Key.
value int Value.
return void

SetString() public method

Sets the string value for a key.
public SetString ( string key, string value ) : void
key string Key.
value string Value.
return void

WriteDataToFile() protected method

Writes the data to file.
protected WriteDataToFile ( ) : void
return void

XMLLocalStore() public method

Initializes a new instance of the XMLLocalStorage class.
public XMLLocalStore ( ) : System
return System

Property Details

FILE_PATH protected_oe static_oe property

protected static string FILE_PATH
return string

_XML_STORE protected_oe static_oe property

protected static XmlStore _XML_STORE
return XmlStore