Application

Chose application
.NET Native Web Flutter
Chose version
ver. 14.0 ver. 13.0 ver. 12.0 ver. 11.0 ver. 10.0 ver. 9.0 ver. 8.0 ver. 7.0 ver. 6.0 ver. 5.0 ver. 4.0
Choose device
Tizen.Applications/n

Assembly:/n: Tizen.Applications.Preference.dll<\/p>\n<p>The Preference class provides methods to store and retrieve application specific data\/preferences. Preferences are stored in the form of key-value pairs.\nKey names must be text strings while values can be integers, doubles, strings, or booleans.<\/p>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">public<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">static<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">class<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Preference<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<p>Inheritance\n: object<\/p>\n<p>Preference<\/p>\n<h2 id=\"content-properties\"><a href=https://samsungtizenos.com/"#content-properties\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Properties<\/h2>\n<p><a href=https://samsungtizenos.com/"https:////github.com//Samsung//TizenFX//blob//main//src//Tizen.Applications.Preference//Tizen.Applications//Preference.cs//#L68\">View Source<\/a><\/p>\n<h4 id=\"content-keys\"><a href=https://samsungtizenos.com/"#content-keys\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Keys<\/h4>\n<p>Retrieves all keys of the application preferences.<\/p>\n<h5 id=\"content-declaration\"><a href=https://samsungtizenos.com/"#content-declaration\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Declaration<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">public<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">static<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">IEnumerable<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&lt;string&gt;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Keys<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> { <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">get<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">; }<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h5 id=\"content-property-value\"><a href=https://samsungtizenos.com/"#content-property-value\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Property Value<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>System.Collections.Generic.IEnumerable&lt;T&gt;<string><\/td>\n<td>The list of keys.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-examples\"><a href=https://samsungtizenos.com/"#content-examples\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Examples<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Set<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#24292E;--shiki-dark:#9ECBFF\">&quot;Option_enabled&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#24292E;--shiki-dark:#79B8FF\">true<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Set<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;Joe&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Set<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;default_volume&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">10<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Set<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;brightness&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;0.6&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">foreach<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">string<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">key<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">in<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Keys<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Console<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">WriteLine<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;key {0}&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">key<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h2 id=\"content-methods\"><a href=https://samsungtizenos.com/"#content-methods\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Methods<\/h2>\n<p><a href=https://samsungtizenos.com/"https:////github.com//Samsung//TizenFX//blob//main//src//Tizen.Applications.Preference//Tizen.Applications//Preference.cs//#L154\">View Source<\/a><\/p>\n<h4 id=\"content-containsstring\"><a href=https://samsungtizenos.com/"#content-containsstring\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Contains(string)<\/h4>\n<p>Checks whether the given key exists in the preference.<\/p>\n<h5 id=\"content-declaration-1\"><a href=https://samsungtizenos.com/"#content-declaration-1\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Declaration<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">public<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">static<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">bool<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Contains<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">string<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#79B8FF\">key<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h5 id=\"content-parameters\"><a href=https://samsungtizenos.com/"#content-parameters\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Parameters<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>string<\/td>\n<td>key<\/td>\n<td>The name of the key to check.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-returns\"><a href=https://samsungtizenos.com/"#content-returns\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Returns<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>bool<\/td>\n<td>True if the key exists in the preference, otherwise false.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-remarks\"><a href=https://samsungtizenos.com/"#content-remarks\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Remarks<\/h5>\n<p>This method checks if the specified key exists in the preferences. It returns true if the key exists, and false if not. The key argument should be a valid parameter. An ArgumentException will be thrown if the key is invalid. Additionally, an IOException may be thrown if the method fails due to an internal input\/output error.<\/p>\n<h5 id=\"content-examples-1\"><a href=https://samsungtizenos.com/"#content-examples-1\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Examples<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Set<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#24292E;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#24292E;--shiki-dark:#9ECBFF\">&quot;Joe&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">bool<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">exists<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Contains<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">if<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">exists<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">string<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">value<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Get<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&lt;<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">istring<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&gt;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Console<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">WriteLine<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;user {0}&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">value<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h5 id=\"content-exceptions\"><a href=https://samsungtizenos.com/"#content-exceptions\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Exceptions<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Condition<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>System.ArgumentException<\/td>\n<td>Thrown if the key is an invalid parameter.<\/td>\n<\/tr>\n<tr>\n<td>System.IO.IOException<\/td>\n<td>Thrown when the method failed due to an internal I\/O error.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<p><a href=https://samsungtizenos.com/"https:////github.com//Samsung//TizenFX//blob//main//src//Tizen.Applications.Preference//Tizen.Applications//Preference.cs//#L240\">View Source<\/a><\/p>\n<h4 id=\"content-gettstring\"><a href=https://samsungtizenos.com/"#content-gettstring\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Get&lt;T&gt;(string)<\/h4>\n<p>Gets the value of a preference item with the specified key.\nNote that this is a generic method.<\/p>\n<h5 id=\"content-declaration-2\"><a href=https://samsungtizenos.com/"#content-declaration-2\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Declaration<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">public<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">static<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">T<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Get<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&lt;<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">T<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&gt;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">string<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">key<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h5 id=\"content-parameters-1\"><a href=https://samsungtizenos.com/"#content-parameters-1\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Parameters<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>string<\/td>\n<td>key<\/td>\n<td>The key of the preference.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-returns-1\"><a href=https://samsungtizenos.com/"#content-returns-1\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Returns<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>T<\/td>\n<td>The value of the preference item if it is of the specified generic type.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-type-parameters\"><a href=https://samsungtizenos.com/"#content-type-parameters\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Type Parameters<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>T<\/td>\n<td>The generic type to return.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-examples-2\"><a href=https://samsungtizenos.com/"#content-examples-2\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Examples<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">bool<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">exists<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Contains<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#24292E;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">if<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">exists<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">string<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">value<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Get<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&lt;string&gt;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Console<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">WriteLine<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;user {0}&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">value<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h5 id=\"content-exceptions-1\"><a href=https://samsungtizenos.com/"#content-exceptions-1\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Exceptions<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Condition<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>System.Collections.Generic.KeyNotFoundException<\/td>\n<td>Thrown if the key is not found.<\/td>\n<\/tr>\n<tr>\n<td>System.ArgumentException<\/td>\n<td>Thrown if the key is an invalid parameter.<\/td>\n<\/tr>\n<tr>\n<td>System.IO.IOException<\/td>\n<td>Thrown when the method failed due to an internal I\/O error.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<p><a href=https://samsungtizenos.com/"https:////github.com//Samsung//TizenFX//blob//main//src//Tizen.Applications.Preference//Tizen.Applications//Preference.cs//#L115\">View Source<\/a><\/p>\n<h4 id=\"content-geteventcontextstring\"><a href=https://samsungtizenos.com/"#content-geteventcontextstring\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>GetEventContext(string)<\/h4>\n<p>Gets the event context for the given key.<\/p>\n<h5 id=\"content-declaration-3\"><a href=https://samsungtizenos.com/"#content-declaration-3\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Declaration<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">public<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">static<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">WeakReference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&lt;<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">EventContext<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">&gt;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">GetEventContext<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">string<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#79B8FF\">key<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h5 id=\"content-parameters-2\"><a href=https://samsungtizenos.com/"#content-parameters-2\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Parameters<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>string<\/td>\n<td>key<\/td>\n<td>The preference key.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-returns-2\"><a href=https://samsungtizenos.com/"#content-returns-2\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Returns<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>System.WeakReference&lt;T&gt;&lt;<a href=https://samsungtizenos.com/"Tizen.Applications.Preference.md/">Preference.EventContext&gt;/nThe event context of respective key.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-examples-3\"><a href=https://samsungtizenos.com/"#content-examples-3\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Examples<\/h5>\n<pre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8;\"><code><span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">private<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">static<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">void<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Preference_PreferenceChanged<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">object<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#79B8FF\">sender<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#D73A49;--shiki-dark:#79B8FF\">PreferenceChangedEventArgs<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#79B8FF\">e<\/span><span style=\"color:#D73A49;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Console<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">WriteLine<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;key {0}&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">e<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Key<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">EventContext<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">context<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">null<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">GetEventContext<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">TryGetTarget<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">out<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">context<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">if<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">context<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">!=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">null<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">context<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Changed<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">+=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference_PreferenceChanged<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">Set<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">, <\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;Poe&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">GetEventContext<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#032F62;--shiki-dark:#9ECBFF\">&quot;active_user&quot;<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#6F42C1;--shiki-dark:#B392F0\">TryGetTarget<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">(<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">out<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">context<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color:#D73A49;--shiki-dark:#F97583\">if<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">context<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">!=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">null<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">context<\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">.<\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Changed<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#D73A49;--shiki-dark:#F97583\">-=<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\"> <\/span><span style=\"color:#005CC5;--shiki-dark:#79B8FF\">Preference_PreferenceChanged<\/span><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color:#24292E;--shiki-dark:#E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre>\n<h5 id=\"content-exceptions-2\"><a href=https://samsungtizenos.com/"#content-exceptions-2\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>Exceptions<\/h5>\n<div class=\"overflow-auto grid table-fixed\" data-table-container=\"data-table-container\"><table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Condition<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>System.Collections.Generic.KeyNotFoundException<\/td>\n<td>Thrown if the key is not found.<\/td>\n<\/tr>\n<tr>\n<td>System.ArgumentException<\/td>\n<td>Thrown if the key is invalid parameter.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h5 id=\"content-see-also\"><a href=https://samsungtizenos.com/"#content-see-also\" class=\"heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">\u00b6<\/a>See Also<\/h5>\n<p><a href=https://samsungtizenos.com/"Tizen.Applications.Preference.md/">Preference.EventContext/n

For the best experience,
Please visit us from a computer

Copyright © 2026 SAMSUNG. All rights reserved.

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.