public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
//check for none
if (value == SvgPaintServer.None) return "none";
var colourServer = value as SvgColourServer;
if (colourServer != null)
{
return new SvgColourConverter().ConvertTo(colourServer.Colour, typeof(string));
}
if (value != null)
{
return string.Format(CultureInfo.InvariantCulture, "url(#{0})", ((SvgPaintServer)value).ID);
}
else
{
return "none";
}
}
return base.ConvertTo(context, culture, value, destinationType);
}
}