Beispiel #1
0
 /// <summary>
 /// Copies the specified BoxEdges instance
 /// </summary>
 /// <param name="original"></param>
 public BoxEdges(BoxEdges original)
 {
     this.top    = original.top;
     this.bottom = original.bottom;
     this.right  = original.right;
     this.left   = original.left;
 }
Beispiel #2
0
 /// <summary>
 /// Copies the specified BoxEdges instance
 /// </summary>
 /// <param name="original"></param>
 public BoxEdges(BoxEdges original)
 {
     this.top = original.top;
     this.bottom = original.bottom;
     this.right = original.right;
     this.left = original.left;
 }
Beispiel #3
0
 /// <summary>
 /// Copies the specified BoxEdges instance
 /// </summary>
 /// <param name="original"></param>
 public BoxEdges(BoxEdges original)
 {
     Top    = original.Top;
     Bottom = original.Bottom;
     Right  = original.Right;
     Left   = original.Left;
 }
Beispiel #4
0
        public static BoxEdges Parse(string text, BoxEdges fallbackValue)
        {
            double[] coords = ParseUtils.ParseList <double>(text, 0, 1, 4);
            if (coords == null)
            {
                return(fallbackValue);                //Failed to parse, or was empty
            }
            if (coords.Length == 1)
            {
                return(new BoxEdges(coords[0]));
            }
            if (coords.Length == 4)
            {
                return(new BoxEdges(coords[0], coords[1], coords[2], coords[3]));
            }

            return(fallbackValue);
        }
Beispiel #5
0
 public BoxEdges SetTop(double top)
 {
     BoxEdges b = new BoxEdges(this); b.top = top;
     return b;
 }
Beispiel #6
0
 public BoxEdges SetRight(double right)
 {
     BoxEdges b = new BoxEdges(this); b.right = right;
     return b;
 }
Beispiel #7
0
 public BoxEdges SetLeft(double left)
 {
     BoxEdges b = new BoxEdges(this); b.left = left;
     return b;
 }
Beispiel #8
0
 public BoxEdges SetBottom(double bottom)
 {
     BoxEdges b = new BoxEdges(this); b.bottom = bottom;
     return b;
 }
Beispiel #9
0
 /// <summary>
 /// Sets the width of all edges, returning a new instance
 /// </summary>
 /// <param name="all"></param>
 /// <returns></returns>
 public BoxEdges SetAll(double all)
 {
     BoxEdges b = new BoxEdges(this); b.all = all;
     return b;
 }
Beispiel #10
0
        public static BoxEdges Parse(string text, BoxEdges fallbackValue)
        {
            double[] coords = ParseUtils.ParseList<double>(text, 0, 1, 4);
            if (coords == null) return fallbackValue; //Failed to parse, or was empty

            if (coords.Length == 1) return new BoxEdges(coords[0]);
            if (coords.Length == 4) return new BoxEdges(coords[0], coords[1], coords[2], coords[3]);

            return fallbackValue;
        }
Beispiel #11
0
        public BoxEdges SetLeft(double left)
        {
            BoxEdges b = new BoxEdges(this); b.left = left;

            return(b);
        }
Beispiel #12
0
        public BoxEdges SetTop(double top)
        {
            BoxEdges b = new BoxEdges(this); b.top = top;

            return(b);
        }
Beispiel #13
0
        /// <summary>
        /// Sets the width of all edges, returning a new instance
        /// </summary>
        /// <param name="all"></param>
        /// <returns></returns>
        public BoxEdges SetAll(double all)
        {
            BoxEdges b = new BoxEdges(this); b.all = all;

            return(b);
        }
Beispiel #14
0
        public BoxEdges SetBottom(double bottom)
        {
            BoxEdges b = new BoxEdges(this); b.bottom = bottom;

            return(b);
        }
Beispiel #15
0
        public BoxEdges SetRight(double right)
        {
            BoxEdges b = new BoxEdges(this); b.right = right;

            return(b);
        }