상속: System.ComponentModel.TypeConverter
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }