1 <?xml version="1.0"?>
\r
4 <name>Tizen.Applications.Preference</name>
\r
7 <member name="T:Interop">
\r
9 Contains interop declarations of the preference classes.
\r
12 <member name="T:Interop.Preference">
\r
14 Contains interop declarations of the preference device API.
\r
17 <member name="T:Tizen.Applications.Preference">
\r
19 The preference class provides APIs to store and retrieve an application specific data/preference. A preference is saved in the form of a key-value pair.
\r
20 Keys are always text strings and the value can be any one of the four types: integer, double, string, and boolean.
\r
23 <member name="P:Tizen.Applications.Preference.Keys">
\r
25 Retrieves all keys of the application preferences.
\r
32 Preference.Set("Option_enabled", true);
\r
33 Preference.Set("active_user", "Joe");
\r
34 Preference.Set("default_volume", 10);
\r
35 Preference.Set("brightness", "0.6");
\r
36 foreach(string key in Preference.Keys)
\r
38 Console.WriteLine("key {0}", key);
\r
43 <member name="M:Tizen.Applications.Preference.GetEventContext(System.String)">
\r
45 Gets the event context for the given key.
\r
47 <seealso cref="T:Tizen.Applications.Preference.EventContext"/>
\r
48 <param name="key">The preference key.</param>
\r
49 <returns>The event context of respective key.</returns>
\r
50 <exception cref="T:System.Collections.Generic.KeyNotFoundException">Thrown if the key is not found.</exception>
\r
51 <exception cref="T:System.ArgumentException">Thrown if the key is invalid parameter.</exception>
\r
54 private static void Preference_PreferenceChanged(object sender, PreferenceChangedEventArgs e)
\r
56 Console.WriteLine("key {0}", e.Key);
\r
59 Preference.EventContext context = null;
\r
60 Preference.GetEventContext("active_user").TryGetTarget(out context);
\r
63 context.Changed += Preference_PreferenceChanged;
\r
66 Preference.Set("active_user", "Poe");
\r
68 Preference.GetEventContext("active_user").TryGetTarget(out context);
\r
69 if (context != null)
\r
71 context.Changed -= Preference_PreferenceChanged;
\r
76 <!-- "M:Tizen.Applications.Preference.Contains(System.String)" 멤버에 대해 잘못된 형식의 XML 주석은 무시됩니다. -->
\r
77 <!-- "M:Tizen.Applications.Preference.Set(System.String,System.Object)" 멤버에 대해 잘못된 형식의 XML 주석은 무시됩니다. -->
\r
78 <!-- "M:Tizen.Applications.Preference.Get``1(System.String)" 멤버에 대해 잘못된 형식의 XML 주석은 무시됩니다. -->
\r
79 <member name="M:Tizen.Applications.Preference.Remove(System.String)">
\r
81 Removes any preference value with the given key.
\r
83 <param name="key">The key to remove.</param>
\r
84 <exception cref="T:System.Collections.Generic.KeyNotFoundException">Thrown if the key is not found.</exception>
\r
85 <exception cref="T:System.IO.IOException">Thrown when the method failed due to an internal I/O error.</exception>
\r
88 bool exists = Preference.Contains("active_user");
\r
91 string value = Preference.Remove("active_user");
\r
96 <member name="M:Tizen.Applications.Preference.RemoveAll">
\r
98 Removes all the key-value pairs from the preference.
\r
100 <exception cref="T:System.IO.IOException">Thrown when the method failed due to an internal I/O error.</exception>
\r
103 Preference.Set("Option_enabled", true);
\r
104 Preference.Set("active_user", "Joe");
\r
105 Preference.Set("default_volume", 10);
\r
106 Preference.Set("brightness", "0.6");
\r
107 Preference.RemoveAll();
\r
111 <member name="T:Tizen.Applications.Preference.EventContext">
\r
113 The class manages event handlers of the preference keys. The class enables having event handlers for individual preference keys.
\r
116 <member name="E:Tizen.Applications.Preference.EventContext.Changed">
\r
118 Occurs whenever there is a change in the value of a preference key.
\r
120 <exception cref="T:System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
\r
121 <exception cref="T:System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
\r
124 private static void Preference_PreferenceChanged(object sender, PreferenceChangedEventArgs e)
\r
126 Console.WriteLine("key {0}", e.Key);
\r
128 Preference.EventContext context = null;
\r
129 Preference.GetEventContext("active_user").TryGetTarget(out context);
\r
130 if(context != null)
\r
132 context.Changed += Preference_PreferenceChanged;
\r
135 Preference.Set("active_user", "Poe");
\r
137 Preference.GetEventContext("active_user").TryGetTarget(out context);
\r
138 if (context != null)
\r
140 context.Changed -= Preference_PreferenceChanged;
\r
145 <member name="T:Tizen.Applications.PreferenceChangedEventArgs">
\r
147 This class is an event argument of the PreferenceChanged event.
\r
150 <member name="P:Tizen.Applications.PreferenceChangedEventArgs.Key">
\r
152 The key of the preference whose value is changed.
\r