OpacityConverter::ConvertTo Method (ITypeDescriptorContext^, CultureInfo^, Object^, Type^)
Converts from the converter's native type to a value of the destination type.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: virtual Object^ ConvertTo( ITypeDescriptorContext^ context, CultureInfo^ culture, Object^ value, Type^ destinationType ) override
Parameters
- context
-
Type:
System.ComponentModel::ITypeDescriptorContext^
A ITypeDescriptorContext that provides information about the context of a type converter.
- culture
-
Type:
System.Globalization::CultureInfo^
The locale information for the conversion.
- value
-
Type:
System::Object^
The value to convert.
- destinationType
-
Type:
System::Type^
The type to convert the object to.
| Exception | Condition |
|---|---|
| ArgumentNullException | destinationType is null. |
| NotSupportedException | value cannot be converted to the destinationType. |
The ConvertTo method is specialized to convert integral values to their String percentage representations. Other types are passed to the base class implementation of this method.
Notes to Inheritors:
Override this method to provide your own conversion requirements.
You can use the context parameter to extract additional information about the environment this converter is being invoked from. The parameter may be null, so you should always verify the contents. Also, properties on the ITypeDescriptorContext may also return null.
The resultant object is a String representing the percentage of opacity.
Available since 1.1