次の方法で共有


PropertySettingsHelper.GetValue Method

Definition

Overloads

GetValue<T>(IPropertySettings, String)

Get Value of type (T)

GetValue<T>(IPropertySettings, String, T)

Get Value of type (T)

GetValue<T>(IPropertySettings, String)

Get Value of type (T)

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T GetValue(Microsoft::VisualStudio::Workspace::IPropertySettings ^ settings, System::String ^ key);
public static T GetValue<T> (this Microsoft.VisualStudio.Workspace.IPropertySettings settings, string key);
static member GetValue : Microsoft.VisualStudio.Workspace.IPropertySettings * string -> 'T
<Extension()>
Public Function GetValue(Of T) (settings As IPropertySettings, key As String) As T

Type Parameters

T

Desired type expected

Parameters

settings
IPropertySettings

The input settings instance

key
String

Key to look for in the configuration

Returns

T

The value contained in the settings

Applies to

GetValue<T>(IPropertySettings, String, T)

Get Value of type (T)

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T GetValue(Microsoft::VisualStudio::Workspace::IPropertySettings ^ settings, System::String ^ key, T defaultValue);
public static T GetValue<T> (this Microsoft.VisualStudio.Workspace.IPropertySettings settings, string key, T defaultValue);
static member GetValue : Microsoft.VisualStudio.Workspace.IPropertySettings * string * 'T -> 'T
<Extension()>
Public Function GetValue(Of T) (settings As IPropertySettings, key As String, defaultValue As T) As T

Type Parameters

T

Desired type expected

Parameters

settings
IPropertySettings

The setting instance

key
String

Key to look for in the configuration

defaultValue
T

Default value to provide if no value is found

Returns

T

The value contained in the configuration or the default value being passed

Applies to