Remarks: This only supports converting from a string supported by the Color.TryParse(string, Color) method. When converting to a string, it converts to a Hex format via Color.ToHex(bool)
obsolete. Use TypeDescriptor.GetConverter instead
Methods
CanConvertFrom
#Determines if this can convert a value with the type of
sourceType to a ColorParameters:
| context (ITypeDescriptorContext) | Context of the conversion |
| sourceType (Type) | Type to convert from |
Returns: True if this can convert to the
sourceType, false otherwiseOverrides: TypeConverter.CanConvertFrom
CanConvertFrom
Determines whether this instance can convert from the specified sourceType.
Parameters:
| sourceType (Type) | Source type to convert from. |
Returns:
true if this instance can convert from the specified sourceType; otherwise, false.CanConvertTo
#Determines if this can convert a Color to the
destinationTypeParameters:
| context (ITypeDescriptorContext) | Context of the conversion |
| destinationType (Type) | Type to convert to |
Returns: True if this converter supports the
destinationType, false otherwiseOverrides: TypeConverter.CanConvertTo
CanConvertTo
Determines whether this instance can convert to the specified destinationType.
Parameters:
| destinationType (Type) | Destination type. |
Returns:
true if this instance can convert to the specified destinationType; otherwise, false.ConvertFrom
#public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Converts the
value to an instance of a ColorParameters:
| context (ITypeDescriptorContext) | Context of the conversion |
| culture (CultureInfo) | Culture to use for the conversion |
| value (object) | Value to convert |
Returns: A Color instance with the converted value
Overrides: TypeConverter.ConvertFrom
Parameters:
| o (object) | Object to convert. |
Returns: The converted object.
ConvertFromInvariantString
Converts from an invariant string.
Parameters:
| context (ITypeDescriptorContext) | Context. |
| text (string) | Text to convert. |
Returns: The from invariant string.
ConvertFromInvariantString
Converts from an invariant string.
Parameters:
| text (string) | Text to convert. |
Returns: The from invariant string.
ConvertFromString
Converts from string.
Parameters:
| context (ITypeDescriptorContext) | Context. |
| culture (CultureInfo) | Culture. |
| text (string) | Text to convert. |
Returns: The converted object.
ConvertFromString
Converts from string.
Parameters:
| context (ITypeDescriptorContext) | Context. |
| text (string) | Text to convert. |
Returns: The converted object.
Parameters:
| text (string) | Text to convert. |
Returns: The converted object.
ConvertTo
#public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converts a Color instance to the specified
destinationTypeParameters:
| context (ITypeDescriptorContext) | Context of the conversion |
| culture (CultureInfo) | Culture to use for the conversion |
| value (object) | Color value to convert |
| destinationType (Type) | Type to convert the value to |
Returns: An object of type
destinationType converted from valueOverrides: TypeConverter.ConvertTo
Returns: The converted object.
ConvertToInvariantString
Converts to invariant string.
Parameters:
| context (ITypeDescriptorContext) | Context. |
| value (object) | Value to convert. |
Returns: The converted string.
ConvertToInvariantString
Converts to an invariant string.
Parameters:
| value (object) | Value to convert. |
Returns: The converted string.
ConvertToString
Converts to a string.
Parameters:
| context (ITypeDescriptorContext) | Context. |
| culture (CultureInfo) | Culture. |
| value (object) | Value to convert. |
Returns: The converted string.
ConvertToString
Converts to a string.
Parameters:
| context (ITypeDescriptorContext) | Context. |
| value (object) | Value to convert. |
Returns: The converted string.
Parameters:
| value (object) | Value to convert. |
Returns: The converted string.
GetConvertFromException
Gets the exception when converting from a value.
Parameters:
| value (object) | Value converted from. |
Returns: The convert from exception.
GetConvertToException
Gets the exception when converting to a value.
Returns: The convert to exception.
IsValid
Determines whether this instance is valid the specified context value.
Parameters:
| context (ITypeDescriptorContext) | Context. |
| value (object) | Value. |
Returns:
true if this instance is valid the specified context value; otherwise, false.IsValid
Determines whether this instance is valid the specified value.
Parameters:
| value (object) | Value. |
Returns:
true if this instance is valid the specified value; otherwise, false.