IconConverter::ConvertTo Method (ITypeDescriptorContext^, CultureInfo^, Object^, Type^)

 

Converts an Icon (or an object that can be cast to an Icon) to a specified type.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public:
virtual Object^ ConvertTo(
	ITypeDescriptorContext^ context,
	CultureInfo^ culture,
	Object^ value,
	Type^ destinationType
) override

Parameters

context
Type: System.ComponentModel::ITypeDescriptorContext^

An ITypeDescriptorContext that provides a format context.

culture
Type: System.Globalization::CultureInfo^

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

value
Type: System::Object^

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

destinationType
Type: System::Type^

The type to convert the icon to.

Return Value

Type: System::Object^

This method returns the converted object.

Exception Condition
NotSupportedException

The conversion could not be performed.

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.

.NET Framework
Available since 1.1
Return to top
Show: