此方法不由 Visual Studio SDK 使用。 使用指定格式的上下文将帮助上下文转换为指定的类型。
命名空间: Microsoft.VisualStudio.Modeling.Design
程序集: Microsoft.VisualStudio.Modeling.Sdk.12.0(在 Microsoft.VisualStudio.Modeling.Sdk.12.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
)
参数
- context
类型:System.ComponentModel.ITypeDescriptorContext
格式上下文。
- culture
类型:System.Globalization.CultureInfo
区域性信息或或当前区域的 null。
- value
类型:System.Object
要转换的对象。
- destinationType
类型:System.Type
要将值转换到的类型。
返回值
类型:System.Object
转换后的值。
异常
异常 | 条件 |
---|---|
ArgumentNullException | destinationType 为 nullnull 引用(在 Visual Basic 中为 Nothing)。 |
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。