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

定义

在给定指定上下文、对象和参数列表的情况下,执行指定目标类型的类型转换。Performs type conversion to the specified destination type given the specified context, object and argument list.

public:
 override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value, Type ^ destinationType);
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType);
override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj
Public Overrides Function ConvertTo (context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object

参数

context
ITypeDescriptorContext

一个 ITypeDescriptorContext 实例,它指示要转换的对象的上下文。An ITypeDescriptorContext instance that indicates the context of the object to convert.

culture
CultureInfo

表示语言、日历系统等区域性信息的 CultureInfo 对象。A CultureInfo object that represents information about a culture such as language, calendar system, and so on. 该方法中不使用此参数。This parameter is not used in this method. 保留它以供该方法的未来版本使用。It is reserved for future versions of this method. 可以选择为此参数传递 nullYou can optionally pass null for this parameter.

value
Object

要转换的对象。The object to convert.

destinationType
Type

要转换为的类型。The type to convert to.

返回

Object

由转换产生的对象。The object resulting from conversion.

适用于