Preferences.Get Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Value for the given key, or the default if it does not exist.