ModelingEnumerationConverter.ConvertTo 方法 (ITypeDescriptorContext, CultureInfo, Object, Type)

使用指定的上下文,转换为指定类型的字段枚举对象。

命名空间:  Microsoft.VisualStudio.Modeling.Design
程序集:  Microsoft.VisualStudio.Modeling.Sdk.11.0(在 Microsoft.VisualStudio.Modeling.Sdk.11.0.dll 中)

语法

声明
Public Overrides Function ConvertTo ( _
    context As ITypeDescriptorContext, _
    culture As CultureInfo, _
    value As Object, _
    destinationType As Type _
) As Object
public override Object ConvertTo(
    ITypeDescriptorContext context,
    CultureInfo culture,
    Object value,
    Type destinationType
)

参数

  • destinationType
    类型:System.Type
    要将值转换到的类型。

返回值

类型:System.Object
转换后的值。

异常

异常 条件
ArgumentNullException

destinationType 为 nullnull 引用(在 Visual Basic 中为 Nothing)。

备注

此转换器只可将枚举对象与字符串相互转换。

默认情况下,区域性参数将被忽略。

对继承者的说明

重写此方法以提供您自己的转换。

.NET Framework 安全性

请参见

参考

ModelingEnumerationConverter 类

ConvertTo 重载

Microsoft.VisualStudio.Modeling.Design 命名空间