แก้ไข

แชร์ผ่าน


ColorConverter.ConvertTo Method

Definition

Converts the specified object to another type.

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);
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

A formatter context. Use this object to extract additional information about the environment from which this converter is being invoked. Always check whether this value is null. Also, properties on the context object may return null.

culture
CultureInfo

A CultureInfo that specifies the culture to represent the color.

value
Object

The object to convert.

destinationType
Type

The type to convert the object to.

Returns

An Object representing the converted value.

Exceptions

destinationtype is null.

The conversion cannot be performed.

Remarks

The most common conversion is to or from a string.

Applies to