public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            WebElementBox wb = value as WebElementBox;

            if (wb != null)
            {
                if (typeof(string).Equals(destinationType))
                {
                    ColorConverter cc = new ColorConverter();
                    StringBuilder  sb = new StringBuilder();
                    if (wb.BorderRadius != 0)
                    {
                        sb.Append(wb.BorderRadius.ToString(CultureInfo.InvariantCulture));
                    }
                    sb.Append(";");
                    if (wb.BoxShadow != 0)
                    {
                        sb.Append(wb.BoxShadow.ToString(CultureInfo.InvariantCulture));
                    }
                    sb.Append(";");
                    if (wb.ShadowColor != Color.Empty)
                    {
                        sb.Append(cc.ConvertToInvariantString(wb.ShadowColor));
                    }
                    sb.Append(";");
                    if (wb.GradientStartColor != Color.Empty)
                    {
                        sb.Append(cc.ConvertToInvariantString(wb.GradientStartColor));
                    }
                    sb.Append(";");
                    if (wb.GradientEndColor != Color.Empty)
                    {
                        sb.Append(cc.ConvertToInvariantString(wb.GradientEndColor));
                    }
                    sb.Append(";");
                    if (wb.GradientAngle != 0)
                    {
                        sb.Append(wb.GradientAngle.ToString(CultureInfo.InvariantCulture));
                    }
                    return(sb.ToString());
                }
            }
            return(base.ConvertTo(context, culture, value, destinationType));
        }
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            string s = value as string;

            if (!string.IsNullOrEmpty(s))
            {
                WebElementBox  wb = new WebElementBox();
                ColorConverter cc = new ColorConverter();
                int            vi;
                float          vf;
                Color          c;
                string[]       ss = s.Split(';');
                if (ss.Length > 0)
                {
                    if (!string.IsNullOrEmpty(ss[0]) && int.TryParse(ss[0], out vi))
                    {
                        wb.BorderRadius = vi;
                    }
                    if (ss.Length > 1)
                    {
                        if (!string.IsNullOrEmpty(ss[1]) && int.TryParse(ss[1], out vi))
                        {
                            wb.BoxShadow = vi;
                        }
                        if (ss.Length > 2)
                        {
                            if (!string.IsNullOrEmpty(ss[2]))
                            {
                                try
                                {
                                    c = (Color)cc.ConvertFromInvariantString(ss[2]);
                                    wb.ShadowColor = c;
                                }
                                catch
                                {
                                }
                            }
                            if (ss.Length > 3)
                            {
                                if (!string.IsNullOrEmpty(ss[3]))
                                {
                                    try
                                    {
                                        c = (Color)cc.ConvertFromInvariantString(ss[3]);
                                        wb.GradientStartColor = c;
                                    }
                                    catch
                                    {
                                    }
                                }
                                if (ss.Length > 4)
                                {
                                    if (!string.IsNullOrEmpty(ss[4]))
                                    {
                                        try
                                        {
                                            c = (Color)cc.ConvertFromInvariantString(ss[4]);
                                            wb.GradientEndColor = c;
                                        }
                                        catch
                                        {
                                        }
                                    }
                                    if (ss.Length > 5)
                                    {
                                        if (float.TryParse(ss[5], out vf))
                                        {
                                            wb.GradientAngle = vf;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                return(wb);
            }
            return(base.ConvertFrom(context, culture, value));
        }