IPreferences.Get<T>(String, T, String) 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.
Gets the value for a given key, or the default specified if the key does not exist.
public T Get<T> (string key, T defaultValue, string? sharedName = default);
abstract member Get : string * 'T * string -> 'T
Public Function Get(Of T) (key As String, defaultValue As T, Optional sharedName As String = Nothing) As T
Type Parameters
- T
The type of the object stored for this preference.
Parameters
- key
- String
The key to retrieve the value for.
- defaultValue
- T
The default value to return when no existing value for key
exists.
- sharedName
- String
Shared container name.
Returns
T
Value for the given key, or the value in defaultValue
if it does not exist.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.