Class SvgColourConverter
- Namespace
- Svg
- Assembly
- Svg.dll
Converts string representations of colours into Color objects.
public class SvgColourConverter : ColorConverter
- Inheritance
-
SvgColourConverter
- Inherited Members
Methods
CanConvertFrom(ITypeDescriptorContext, Type)
Determines if this converter can convert an object in the given source type to the native type of the converter.
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context. You can use this object to get additional information about the environment from which this converter is being invoked.
sourceType
TypeThe type from which you want to convert.
Returns
CanConvertTo(ITypeDescriptorContext, Type)
Returns a value indicating whether this converter can convert an object to the given destination type using the context.
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
destinationType
TypeA Type that represents the type to which you want to convert.
Returns
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Converts the given object to the converter's native type.
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
context
ITypeDescriptorContextA TypeDescriptor that provides a format context. You can use this object to get additional information about the environment from which this converter is being invoked.
culture
CultureInfoA CultureInfo that specifies the culture to represent the color.
value
objectThe object to convert.
Returns
Exceptions
- ArgumentException
The conversion cannot be performed.
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Converts the specified object to another type.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
context
ITypeDescriptorContextA 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
CultureInfoA CultureInfo that specifies the culture to represent the color.
value
objectThe object to convert.
destinationType
TypeThe type to convert the object to.
Returns
Exceptions
- ArgumentNullException
destinationtype
is null.- NotSupportedException
The conversion cannot be performed.