IconConverter.ConvertTo Method

Definition

Converts an Icon (or an object that can be cast to an Icon) to a specified 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

An ITypeDescriptorContext that provides a format context.

culture
CultureInfo

A CultureInfo object that specifies formatting conventions used by a particular culture.

value
Object

The object to convert. This object should be of type icon or some type that can be cast to Icon.

destinationType
Type

The type to convert the icon to.

Returns

This method returns the converted object.

Exceptions

The conversion could not be performed.

Remarks

The default implementation calls the ToString method on the object if the object is valid and if the destination type is string. If this method cannot convert to the destination type, it throws a NotSupportedException exception.

Applies to