Share via


ISettingsReader.GetValueOrThrow Method

Definition

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 targetType, returns the default value.

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.

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

T

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.

Applies to