Share via


Preferences.Get Method

Definition

Overloads

Get(String, String, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int64, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int32, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Double, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, DateTimeOffset, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, DateTime, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Boolean, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Single, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Single)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int64)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int32)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Double)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, DateTimeOffset)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, DateTime)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Boolean)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, String, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static System::String ^ Get(System::String ^ key, System::String ^ defaultValue, System::String ^ sharedName);
public static string? Get (string key, string? defaultValue, string? sharedName);
static member Get : string * string * string -> string
Public Shared Function Get (key As String, defaultValue As String, sharedName As String) As String

Parameters

key
String

Preference key.

defaultValue
String

Default value to return if the key does not exist.

sharedName
String

Shared container key.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Int64, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static long Get(System::String ^ key, long defaultValue, System::String ^ sharedName);
public static long Get (string key, long defaultValue, string? sharedName);
static member Get : string * int64 * string -> int64
Public Shared Function Get (key As String, defaultValue As Long, sharedName As String) As Long

Parameters

key
String

Preference key.

defaultValue
Int64

Default value to return if the key does not exist.

sharedName
String

Shared container key.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Int32, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static int Get(System::String ^ key, int defaultValue, System::String ^ sharedName);
public static int Get (string key, int defaultValue, string? sharedName);
static member Get : string * int * string -> int
Public Shared Function Get (key As String, defaultValue As Integer, sharedName As String) As Integer

Parameters

key
String

Preference key.

defaultValue
Int32

Default value to return if the key does not exist.

sharedName
String

Shared container key.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Double, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static double Get(System::String ^ key, double defaultValue, System::String ^ sharedName);
public static double Get (string key, double defaultValue, string? sharedName);
static member Get : string * double * string -> double
Public Shared Function Get (key As String, defaultValue As Double, sharedName As String) As Double

Parameters

key
String

Preference key.

defaultValue
Double

Default value to return if the key does not exist.

sharedName
String

Shared container key.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, DateTimeOffset, String)

Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static DateTimeOffset Get(System::String ^ key, DateTimeOffset defaultValue, System::String ^ sharedName);
public static DateTimeOffset Get (string key, DateTimeOffset defaultValue, string? sharedName);
static member Get : string * DateTimeOffset * string -> DateTimeOffset
Public Shared Function Get (key As String, defaultValue As DateTimeOffset, sharedName As String) As DateTimeOffset

Parameters

key
String

The key to retrieve the value for.

defaultValue
DateTimeOffset

The default value to return when no existing value for key exists.

sharedName
String

Shared container name.

Returns

Value for the given key, or the value in defaultValue if it does not exist.

Applies to

Get(String, DateTime, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static DateTime Get(System::String ^ key, DateTime defaultValue, System::String ^ sharedName);
public static DateTime Get (string key, DateTime defaultValue, string? sharedName);
static member Get : string * DateTime * string -> DateTime
Public Shared Function Get (key As String, defaultValue As DateTime, sharedName As String) As DateTime

Parameters

key
String

Preference key.

defaultValue
DateTime

Default value to return if the key does not exist.

sharedName
String

Shared container key.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Boolean, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static bool Get(System::String ^ key, bool defaultValue, System::String ^ sharedName);
public static bool Get (string key, bool defaultValue, string? sharedName);
static member Get : string * bool * string -> bool
Public Shared Function Get (key As String, defaultValue As Boolean, sharedName As String) As Boolean

Parameters

key
String

Preference key.

defaultValue
Boolean

Default value to return if the key does not exist.

sharedName
String

Shared container key.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Single, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static float Get(System::String ^ key, float defaultValue, System::String ^ sharedName);
public static float Get (string key, float defaultValue, string? sharedName);
static member Get : string * single * string -> single
Public Shared Function Get (key As String, defaultValue As Single, sharedName As String) As Single

Parameters

key
String

Preference key.

defaultValue
Single

Default value to return if the key does not exist.

sharedName
String

Shared container key.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Single)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static float Get(System::String ^ key, float defaultValue);
public static float Get (string key, float defaultValue);
static member Get : string * single -> single
Public Shared Function Get (key As String, defaultValue As Single) As Single

Parameters

key
String

Preference key.

defaultValue
Single

Default value to return if the key does not exist.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Int64)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static long Get(System::String ^ key, long defaultValue);
public static long Get (string key, long defaultValue);
static member Get : string * int64 -> int64
Public Shared Function Get (key As String, defaultValue As Long) As Long

Parameters

key
String

Preference key.

defaultValue
Int64

Default value to return if the key does not exist.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Int32)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static int Get(System::String ^ key, int defaultValue);
public static int Get (string key, int defaultValue);
static member Get : string * int -> int
Public Shared Function Get (key As String, defaultValue As Integer) As Integer

Parameters

key
String

Preference key.

defaultValue
Int32

Default value to return if the key does not exist.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, Double)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static double Get(System::String ^ key, double defaultValue);
public static double Get (string key, double defaultValue);
static member Get : string * double -> double
Public Shared Function Get (key As String, defaultValue As Double) As Double

Parameters

key
String

Preference key.

defaultValue
Double

Default value to return if the key does not exist.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, DateTimeOffset)

Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static DateTimeOffset Get(System::String ^ key, DateTimeOffset defaultValue);
public static DateTimeOffset Get (string key, DateTimeOffset defaultValue);
static member Get : string * DateTimeOffset -> DateTimeOffset
Public Shared Function Get (key As String, defaultValue As DateTimeOffset) As DateTimeOffset

Parameters

key
String

The key to retrieve the value for.

defaultValue
DateTimeOffset

The default value to return when no existing value for key exists.

Returns

Value for the given key, or the value in defaultValue if it does not exist.

Applies to

Get(String, DateTime)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static DateTime Get(System::String ^ key, DateTime defaultValue);
public static DateTime Get (string key, DateTime defaultValue);
static member Get : string * DateTime -> DateTime
Public Shared Function Get (key As String, defaultValue As DateTime) As DateTime

Parameters

key
String

Preference key.

defaultValue
DateTime

Default value to return if the key does not exist.

Returns

Value for the given key, or the default if it does not exist.

Applies to

Get(String, String)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static System::String ^ Get(System::String ^ key, System::String ^ defaultValue);
public static string? Get (string key, string? defaultValue);
static member Get : string * string -> string
Public Shared Function Get (key As String, defaultValue As String) As String

Parameters

key
String

The key to retrieve the value for.

defaultValue
String

The default value to return when no existing value for key exists.

Returns

Value for the given key, or the value in defaultValue if it does not exist.

Applies to

Get(String, Boolean)

Source:
Preferences.shared.cs
Source:
Preferences.shared.cs

Gets the value for a given key, or the default specified if the key does not exist.

public:
 static bool Get(System::String ^ key, bool defaultValue);
public static bool Get (string key, bool defaultValue);
static member Get : string * bool -> bool
Public Shared Function Get (key As String, defaultValue As Boolean) As Boolean

Parameters

key
String

Preference key.

defaultValue
Boolean

Default value to return if the key does not exist.

Returns

Value for the given key, or the default if it does not exist.

Applies to