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, 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, DateTime)

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)

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

Get(String, String, String)

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

public static string Get (string key, string defaultValue, string sharedName);

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.

Get(String, Int64, String)

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

public static long Get (string key, long defaultValue, string sharedName);

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.

Get(String, Int32, String)

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

public static int Get (string key, int defaultValue, string sharedName);

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.

Get(String, Double, String)

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

public static double Get (string key, double defaultValue, string sharedName);

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.

Get(String, DateTime, String)

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

public static DateTime Get (string key, DateTime defaultValue, string sharedName);

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.

Remarks

Get(String, Boolean, String)

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

public static bool Get (string key, bool defaultValue, string sharedName);

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.

Remarks

Get(String, Single, String)

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

public static float Get (string key, float defaultValue, string sharedName);

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.

Get(String, Single)

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

public static float Get (string key, float defaultValue);

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.

Get(String, Int64)

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

public static long Get (string key, long defaultValue);

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.

Get(String, Int32)

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

public static int Get (string key, int defaultValue);

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.

Get(String, Double)

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

public static double Get (string key, double defaultValue);

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.

Get(String, DateTime)

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

public static DateTime Get (string key, DateTime defaultValue);

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.

Get(String, Boolean)

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

public static bool Get (string key, bool defaultValue);

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.

Get(String, String)

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

public static string Get (string key, string defaultValue);

Parameters

key
String

Preference key.

defaultValue
String

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