Halyri - Mobiili  0.9.1
 All Classes Namespaces Functions Enumerations Properties
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 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"
 
const String SELECTEDCULTURE = "selectedCulture"
 

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

Settings ( )

initializes settings.

Member Function Documentation

void 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 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 RemoveSetting ( String  key)

Removes setting using given key.

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

Save the settings.


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