Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

UserPreference class

From Catglobe Wiki
Revision as of 07:50, 24 November 2016 by Nguyenduyan (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=UserPreference |Description=A user preference |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGscriptParameters_Template|Type=stri...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UserPreference



A user preference

Constructors

  • (string navName "Navigation access value was stored with", int prefType "Unique key for the setting") - Get existing a new personalized stored value.
  • (string navName "Navigation access to associate the value with", int prefType "Unique key for the setting", string value "Value to store") - Create a new or update existing personalized stored value.

Methods

  • Empty Save() - Save the current value
  • string ToString() - The string representation of the object.

Properties

  • string ObjectTypeName { get; } - The name of the type of object.
  • TypeInformation TypeInformation { get; } - Get information about this class.
  • string Value { get; set; } - Get/Set the current value



Examples

//create a new userPreference
string navName="Questionnaire_Search";
number prefType=1;
string value="Hello world";
UserPreference pref = new UserPreference(navName, prefType,value);
pref.Save();


//Get existing userPreference
string navName="Questionnaire_Search";
number prefType=1;
UserPreference pref = new UserPreference(navName, prefType);
print(pref.Value);//return: Hello world


//Update an existing userPreference
string navName="Questionnaire_Search";
number prefType=1;
string value="abc xyz";
UserPreference pref = new UserPreference(navName, prefType, value);
pref.Save();
print(pref.Value);//return: abc xyz