Share via


SettingValues.Value Method

Definition

Overloads

Value<T>(Setting+ObjectArray)

Gets the value of setting converted to the type T.

Value<T>(Setting<T>)

Gets the value of setting converted to the type T.

Value<T>(SettingIdentifier<T>)

Gets the value of settingId converted to the type T.

Value<T>(Setting+ObjectArray)

Gets the value of setting converted to the type T.

public T[] Value<T> (Microsoft.VisualStudio.Extensibility.Settings.Setting.ObjectArray setting) where T : Microsoft.VisualStudio.Extensibility.Settings.IArraySettingItemConvertible, new();
member this.Value : Microsoft.VisualStudio.Extensibility.Settings.Setting.ObjectArray -> 'T[] (requires 'T :> Microsoft.VisualStudio.Extensibility.Settings.IArraySettingItemConvertible and 'T : (new : unit -> 'T))
Public Function Value(Of T As {IArraySettingItemConvertibleNew}) (setting As Setting.ObjectArray) As T()

Type Parameters

T

The expected type of the setting, only valid types for Setting<T> are supported.

Parameters

setting
Setting.ObjectArray

The setting for which the value is to be retrieved.

Returns

T[]

The value converted to the type T.

Exceptions

The conversion of the value to T is not supported.

The value is not in a format recognized by InvariantCulture for T.

The value represents a number that is out of the range of T.

The setting value for setting is not found in the dictionary.

An error occurred when retrieving the setting value. To avoid this exception being raised, either use ValueOrDefault<T>(Setting<T>, T), or Item[SettingIdentifier] followed by checking Succeeded before Value<T>().

Applies to

Value<T>(Setting<T>)

Gets the value of setting converted to the type T.

public T Value<T> (Microsoft.VisualStudio.Extensibility.Settings.Setting<T> setting);
member this.Value : Microsoft.VisualStudio.Extensibility.Settings.Setting<'T> -> 'T
Public Function Value(Of T) (setting As Setting(Of T)) As T

Type Parameters

T

The expected type of the setting, only valid types for Setting<T> are supported.

Parameters

setting
Setting<T>

The setting for which the value is to be retrieved.

Returns

T

The value converted to the type T.

Exceptions

The conversion of the value to T is not supported.

The value is not in a format recognized by InvariantCulture for T.

The value represents a number that is out of the range of T.

The setting value for setting is not found in the dictionary.

An error occurred when retrieving the setting value. To avoid this exception being raised, either use ValueOrDefault<T>(Setting<T>, T), or Item[SettingIdentifier] followed by checking Succeeded before Value<T>().

Applies to

Value<T>(SettingIdentifier<T>)

Gets the value of settingId converted to the type T.

public T Value<T> (Microsoft.VisualStudio.Extensibility.Settings.SettingIdentifier<T> settingId);
member this.Value : Microsoft.VisualStudio.Extensibility.Settings.SettingIdentifier<'T> -> 'T
Public Function Value(Of T) (settingId As SettingIdentifier(Of T)) As T

Type Parameters

T

The expected type of the setting, only valid types for Setting<T> are supported.

Parameters

settingId
SettingIdentifier<T>

The full identifier of the setting, including the categories it is nested under.

Returns

T

The value converted to the type T.

Exceptions

If T is not a supported type of Setting<T>.

The conversion of the value to T is not supported.

The value is not in a format recognized by InvariantCulture for T.

The value represents a number that is out of the range of T.

An error occurred when retrieving the setting value. To avoid this exception being raised, either use ValueOrDefault<T>(SettingIdentifier<T>, T), or Item[SettingIdentifier] followed by checking Succeeded before Value<T>().

The setting value for settingId is not found in the dictionary.

Applies to