Halyri  0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Halyri.Settings Class Reference

Application can store any objects here that last while program is terminated. You have to always save by using Save() or modifications do not take place in storage. USE KEYS DEFINED HERE AS PUBLIC CONSTS. More...

Public Member Functions

 Settings ()
 initializes settings. More...
 
void AddOrUpdateValue (string Key, Object value)
 Update a setting value for our application. If the setting does not exist, then add the setting. More...
 
bool RemoveSetting (String key)
 Removes setting using given key. More...
 
GetValueOrDefault< T > (string Key, T defaultValue)
 Get the current value of the setting, or if it is not found, set the setting to the default setting. More...
 
void Save ()
 Save the settings. More...
 

Public Attributes

const String GUID = "guid"
 
const String SELECTEDLANGUAGEINDEX = "selectedLanguageIndex"
 
const String ISGPSENABLED = "isGpsEnabled"
 
const String FONTSIZE = "fontSize"
 
const String STREETADDRESS = "streetName"
 
const String POSTALCODE = "postalCode"
 
const String LOCALITY = "locality"
 
const String OWNERNAME = "ownerName"
 
const String PHONENUMBERS = "phoneNumbers"
 
const String CONNECTION = "connection"
 

Detailed Description

Application can store any objects here that last while program is terminated. You have to always save by using Save() or modifications do not take place in storage. USE KEYS DEFINED HERE AS PUBLIC CONSTS.

Constructor & Destructor Documentation

Halyri.Settings.Settings ( )

initializes settings.

Member Function Documentation

void Halyri.Settings.AddOrUpdateValue ( string  Key,
Object  value 
)

Update a setting value for our application. If the setting does not exist, then add the setting.

Parameters
KeyKey is string like search parameter that is used to store object
valueThe object that you like to store
Returns
True if value is changed and false if not
T Halyri.Settings.GetValueOrDefault< T > ( string  Key,
defaultValue 
)

Get the current value of the setting, or if it is not found, set the setting to the default setting.

Template Parameters
TType of item
Parameters
KeyKey for searching item
defaultValueIf item is not found returns this
Returns
bool Halyri.Settings.RemoveSetting ( String  key)

Removes setting using given key.

Parameters
keyKey to setting
Returns
True if succesful.
void Halyri.Settings.Save ( )

Save the settings.

Member Data Documentation

const String Halyri.Settings.CONNECTION = "connection"
const String Halyri.Settings.FONTSIZE = "fontSize"
const String Halyri.Settings.GUID = "guid"
const String Halyri.Settings.ISGPSENABLED = "isGpsEnabled"
const String Halyri.Settings.LOCALITY = "locality"
const String Halyri.Settings.OWNERNAME = "ownerName"
const String Halyri.Settings.PHONENUMBERS = "phoneNumbers"
const String Halyri.Settings.POSTALCODE = "postalCode"
const String Halyri.Settings.SELECTEDLANGUAGEINDEX = "selectedLanguageIndex"
const String Halyri.Settings.STREETADDRESS = "streetName"

The documentation for this class was generated from the following file: