共用方式為


PackageUtilities.ConvertToType<T> Method

Converts a string to an enumeration type.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Public Shared Function ConvertToType(Of T As Structure) ( _
    value As T, _
    typeToConvert As Type, _
    culture As CultureInfo _
) As Object
public static Object ConvertToType<T>(
    T value,
    Type typeToConvert,
    CultureInfo culture
)
where T : struct
public:
generic<typename T>
where T : value class 
static Object^ ConvertToType(
    T value, 
    Type^ typeToConvert, 
    CultureInfo^ culture
)
static member ConvertToType : 
        value:'T * 
        typeToConvert:Type * 
        culture:CultureInfo -> Object   when 'T : struct
JScript does not support generic types or methods.

Type Parameters

  • T
    The enum to which to convert.

Parameters

  • value
    Type: T

    The enumeration to which the string is to be converted.

  • typeToConvert
    Type: Type

    The value to convert.

  • culture
    Type: CultureInfo

    A CultureInfo object that describes the culture to use to read localized strings.

Return Value

Type: Object
The enumeration type.

.NET Framework Security

See Also

Reference

PackageUtilities Class

Microsoft.VisualStudio.Shell Namespace