public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture,
                                  object value, Type destinationType)
 {
     if (destinationType == typeof(string) && value is StiBorderSide)
     {
         if (value == null)
         {
             return("null");
         }
         else
         {
             StiBorderSide side = value as StiBorderSide;
             if (side.side == StiBorderSides.Top)
             {
                 return("(" + StiLocalization.Get("PropertyMain", "TopSide") + ")");
             }
             if (side.side == StiBorderSides.Bottom)
             {
                 return("(" + StiLocalization.Get("PropertyMain", "BottomSide") + ")");
             }
             if (side.side == StiBorderSides.Left)
             {
                 return("(" + StiLocalization.Get("PropertyMain", "LeftSide") + ")");
             }
             if (side.side == StiBorderSides.Right)
             {
                 return("(" + StiLocalization.Get("PropertyMain", "RightSide") + ")");
             }
         }
     }
     return(base.ConvertTo(context, culture, value, destinationType));
 }
            public static string JBorderSide(StiBorderSide side)
            {
                string color = JColor(side.Color, Color.Black);

                string size = string.Empty;

                if (side.Size != 1d)
                {
                    size = side.Size.ToString();
                }

                string style = string.Empty;

                if (side.Style != StiPenStyle.None)
                {
                    style = side.Style.ToString();
                }

                return(color + ":" + size + ":" + style);
            }
            public static StiBorderSide JBorderSide(string text)
            {
                var values = text.Split(':');
                var side   = new StiBorderSide();

                if (!string.IsNullOrEmpty(values[0]))
                {
                    side.Color = Color(values[0]);
                }

                if (!string.IsNullOrEmpty(values[1]))
                {
                    side.Size = double.Parse(values[1]);
                }

                if (!string.IsNullOrEmpty(values[2]))
                {
                    side.Style = (StiPenStyle)Enum.Parse(typeof(StiPenStyle), values[2]);
                }

                return(side);
            }