ISettingsReader.GetValueOrThrow 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
GetValueOrThrow(String, Type) |
Gets a non-array setting. If there is no persisted value, the persisted value is invalid,
or the persisted value can't be converted to |
GetValueOrThrow<T>(String) |
Gets a non-array setting. If there is no persisted value, the persisted value is invalid,
or the persisted value can't be converted to |
GetValueOrThrow(String, Type)
Gets a non-array setting. If there is no persisted value, the persisted value is invalid,
or the persisted value can't be converted to targetType
, returns the default value.
public object GetValueOrThrow (string moniker, Type targetType);
abstract member GetValueOrThrow : string * Type -> obj
Public Function GetValueOrThrow (moniker As String, targetType As Type) As Object
Parameters
- moniker
- String
- targetType
- Type
Returns
Exceptions
Thrown if targetType
isn't compatible with the persisted value or the default value.
Thrown if the setting isn't registered and there's no persisted value.
Thrown if moniker
is null.
Thrown if moniker
is empty.
Applies to
GetValueOrThrow<T>(String)
Gets a non-array setting. If there is no persisted value, the persisted value is invalid,
or the persisted value can't be converted to T
, returns the default value.
public T GetValueOrThrow<T> (string moniker);
abstract member GetValueOrThrow : string -> 'T
Public Function GetValueOrThrow(Of T) (moniker As String) As T
Type Parameters
- T
Parameters
- moniker
- String
Returns
Exceptions
Thrown if T
isn't compatible with the persisted value or the default value.
Thrown if the setting isn't registered and there's no persisted value.
Thrown if moniker
is null.
Thrown if moniker
is empty.