UserPreference class

From Catglobe Wiki
Revision as of 10:10, 26 March 2020 by Administrator (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

UserPreference



A user preference

Parent class

Inherits from object

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
  • (From object) string ToString() - The string representation of the object.

Properties

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

Static Methods

  • Array of UserPreference UserPreference_getAll(string navName "Navigation access value was stored with") - Get all user preferences for a given navName

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