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
System.String

Preference key.

defaultValue
System.String

Default value to return if the key does not exist.

sharedName
System.String

Shared container key.

Returns

System.String

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

Applies to

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
System.String

Preference key.

defaultValue
System.Int64

Default value to return if the key does not exist.

sharedName
System.String

Shared container key.

Returns

System.Int64

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

Applies to

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
System.String

Preference key.

defaultValue
System.Int32

Default value to return if the key does not exist.

sharedName
System.String

Shared container key.

Returns

System.Int32

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

Applies to

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
System.String

Preference key.

defaultValue
System.Double

Default value to return if the key does not exist.

sharedName
System.String

Shared container key.

Returns

System.Double

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

Applies to

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
System.String

Preference key.

defaultValue
System.DateTime

Default value to return if the key does not exist.

sharedName
System.String

Shared container key.

Returns

System.DateTime

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

Applies to

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
System.String

Preference key.

defaultValue
System.Boolean

Default value to return if the key does not exist.

sharedName
System.String

Shared container key.

Returns

System.Boolean

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

Applies to

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
System.String

Preference key.

defaultValue
System.Single

Default value to return if the key does not exist.

sharedName
System.String

Shared container key.

Returns

System.Single

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

Applies to

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
System.String

Preference key.

defaultValue
System.Single

Default value to return if the key does not exist.

Returns

System.Single

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

Applies to

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
System.String

Preference key.

defaultValue
System.Int64

Default value to return if the key does not exist.

Returns

System.Int64

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

Applies to

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
System.String

Preference key.

defaultValue
System.Int32

Default value to return if the key does not exist.

Returns

System.Int32

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

Applies to

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
System.String

Preference key.

defaultValue
System.Double

Default value to return if the key does not exist.

Returns

System.Double

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

Applies to

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
System.String

Preference key.

defaultValue
System.DateTime

Default value to return if the key does not exist.

Returns

System.DateTime

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

Applies to

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
System.String

Preference key.

defaultValue
System.Boolean

Default value to return if the key does not exist.

Returns

System.Boolean

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

Applies to

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
System.String

Preference key.

defaultValue
System.String

Default value to return if the key does not exist.

Returns

System.String

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

Applies to