コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeRectangle'/> class with the specified location and size.
 /// </summary>
 public RelativeRectangle(RelativePoint location, RelativeSize size)
 {
     x      = location.X;
     y      = location.Y;
     width  = size.Width;
     height = size.Height;
 }
コード例 #2
0
 /// <summary>
 /// Inflates this <see cref='RelativeRectangle'/> by the specified amount.
 /// </summary>
 public void Inflate(RelativeLength x, RelativeLength y)
 {
     X      -= x;
     Y      -= y;
     Width  += 2 * x;
     Height += 2 * y;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeRectangle'/> class with the specified location and size.
 /// </summary>
 public RelativeRectangle(RelativeLength x, RelativeLength y, RelativeLength width, RelativeLength height)
 {
     this.x      = x;
     this.y      = y;
     this.width  = width;
     this.height = height;
 }
コード例 #4
0
        /// <summary>
        /// Creates a <see cref='RelativeRectangle'/> that is inflated by the specified amount.
        /// </summary>
        public static RelativeRectangle Inflate(RelativeRectangle rect, RelativeLength x, RelativeLength y)
        {
            RelativeRectangle r = rect;

            r.Inflate(x, y);
            return(r);
        }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeThickness'/> class.
 /// </summary>
 public RelativeThickness(RelativeLength top, RelativeLength right, RelativeLength bottom, RelativeLength left)
 {
     this.top    = top;
     this.right  = right;
     this.bottom = bottom;
     this.left   = left;
 }
コード例 #6
0
 /// <summary>
 /// Inflates this <see cref='RelativeThickness'/> by the specified amount.
 /// </summary>
 public void Inflate(RelativeLength value)
 {
     Top    += value;
     Right  += value;
     Bottom += value;
     Left   += value;
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativePoint'/> class with the specified coordinates.
 /// </summary>
 public RelativePoint(RelativeLength x, RelativeLength y)
 {
     this.x = x;
     this.y = y;
 }
コード例 #8
0
 /// <summary>
 /// Creates a new <see cref='RelativeRectangle'/> with the specified location and size.
 /// </summary>
 public static RelativeRectangle FromLTRB(RelativeLength left, RelativeLength top, RelativeLength right, RelativeLength bottom) =>
 new RelativeRectangle(left, top, right - left, bottom - top);
コード例 #9
0
 /// <summary>
 /// Adjusts the location of this rectangle by the specified amount.
 /// </summary>
 public void Offset(RelativeLength x, RelativeLength y)
 {
     X += x;
     Y += y;
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeSize'/> class from the specified dimensions.
 /// </summary>
 public RelativeSize(RelativeLength width, RelativeLength height)
 {
     this.width  = width;
     this.height = height;
 }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeSize'/> class from the specified <see cref='RelativePoint'/>.
 /// </summary>
 public RelativeSize(RelativePoint pt)
 {
     width  = pt.X;
     height = pt.Y;
 }
コード例 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref='RelativeSize'/> class from the specified existing <see cref='RelativeSize'/>.
 /// </summary>
 public RelativeSize(RelativeSize size)
 {
     width  = size.width;
     height = size.height;
 }