PackageUtilities.ConvertToType<T> Method

Converts a string to an enumeration type.

This API is not CLS-compliant. The CLS-compliant alternative is [None].

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

声明
<CLSCompliantAttribute(False)> _
Public Shared Function ConvertToType(Of T As {Structure, New}) ( _
    value As T, _
    typeToConvert As Type, _
    culture As CultureInfo _
) As Object
用法
Dim value As T
Dim typeToConvert As Type
Dim culture As CultureInfo
Dim returnValue As Object

returnValue = PackageUtilities.ConvertToType(value, _
    typeToConvert, culture)
[CLSCompliantAttribute(false)]
public static Object ConvertToType<T>(
    T value,
    Type typeToConvert,
    CultureInfo culture
)
where T : struct, new()
[CLSCompliantAttribute(false)]
public:
generic<typename T>
where T : value class, gcnew()
static Object^ ConvertToType(
    T value, 
    Type^ typeToConvert, 
    CultureInfo^ culture
)
[<CLSCompliantAttribute(false)>]
static member ConvertToType : 
        value:'T * 
        typeToConvert:Type * 
        culture:CultureInfo -> Object  when 'T : struct, new()
JScript does not support generic types or methods.

Type Parameters

  • T

Parameters

  • value
    Type: T
    The enumeration to which the string is to be converted.
  • typeToConvert
    Type: System.Type
    The value to convert.

Return Value

Type: System.Object
The enumeration type.

.NET Framework Security

See Also

Reference

PackageUtilities Class

PackageUtilities Members

Microsoft.VisualStudio.Shell Namespace