public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) { return(ColorConverterCommon.ConvertFromString(strValue, culture ?? CultureInfo.CurrentCulture)); } return(base.ConvertFrom(context, culture, value)); }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string strValue = value as string; if (strValue != null) { return(ColorConverterCommon.ConvertFromString(strValue, culture)); } return(base.ConvertFrom(context, culture, value)); }