示例#1
0
        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));
        }
示例#2
0
        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));
        }