public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value is string) { return(SvgPaintServerFactory.Create((string)value, (SvgDocument)context)); } return(base.ConvertFrom(context, culture, value)); }
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value is string) { var s = (string)value; if (String.Equals(s.Trim(), "none", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(s) || s.Trim().Length < 1) { return(SvgPaintServer.None); } else { return(SvgPaintServerFactory.Create(s, (SvgDocument)context)); } } return(base.ConvertFrom(context, culture, value)); }
public override SvgPaintServer Convert(string value, SvgDocument context) { if (value is string) { var s = (string)value; if (String.Equals(s.Trim(), "none", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(s) || s.Trim().Length < 1) { return(SvgPaintServer.None); } else { return(SvgPaintServerFactory.Create(s, (SvgDocument)context)); } } return(SvgPaintServer.None); }