TreeNodeConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) Method

Definition

使用指定的上下文和区域性信息将给定值对象转换为指定的类型。Converts the given value object to the specified type, using the specified context and culture information.

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

Parameters

context
ITypeDescriptorContext

一个 ITypeDescriptorContext,用于提供格式上下文。An ITypeDescriptorContext that provides a format context.

culture
CultureInfo

CultureInfoA CultureInfo. 如果传递 null,则采用当前区域性。If null is passed, the current culture is assumed.

value
Object

要转换的 ObjectThe Object to convert.

destinationType
Type

值参数所要转换成的 TypeThe Type to convert the value parameter to.

Returns

Object

一个 Object,它表示转换后的值。An Object that represents the converted value.

Applies to

See also