Table of Contents

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 ITypeDescriptorContext

An 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 Type

The type from which you want to convert.

Returns

bool

true if this object can perform the conversion; otherwise, false.

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 ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

destinationType Type

A Type that represents the type to which you want to convert.

Returns

bool

true if this converter can perform the operation; otherwise, false.

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 ITypeDescriptorContext

A 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 CultureInfo

A CultureInfo that specifies the culture to represent the color.

value object

The object to convert.

Returns

object

An object representing the converted value.

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 ITypeDescriptorContext

A 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 CultureInfo

A CultureInfo that specifies the culture to represent the color.

value object

The object to convert.

destinationType Type

The type to convert the object to.

Returns

object

An object representing the converted value.

Exceptions

ArgumentNullException

destinationtype is null.

NotSupportedException

The conversion cannot be performed.