Calls a converter to convert an enumeration to a specific type.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.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 = Utilities.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
)
JScript does not support generic types or methods.
Type Parameters
- T
Parameters
value
Type: TThe enumeration to convert.
typeToConvert
Type: System.TypeThe type to which the enumeration should be converted.
culture
Type: System.Globalization.CultureInfoThe CultureInfo of the string.
Return Value
Type: System.Object
The converted type.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.