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
contextITypeDescriptorContextAn 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.
sourceTypeTypeThe 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
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
destinationTypeTypeA 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
contextITypeDescriptorContextA 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.
cultureCultureInfoA CultureInfo that specifies the culture to represent the color.
valueobjectThe 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
contextITypeDescriptorContextA 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.
cultureCultureInfoA CultureInfo that specifies the culture to represent the color.
valueobjectThe object to convert.
destinationTypeTypeThe type to convert the object to.
Returns
Exceptions
- ArgumentNullException
destinationtypeis null.- NotSupportedException
The conversion cannot be performed.