Download SliceRectangleSample.zip, last updated 10/02/2013 (23.18 KB)

Download
  • md5: 1e8ccdf10305cc43789e4fa28c96006b
using System.Drawing;

namespace SliceRectangleSample
{
  internal class Segment
  {
    #region Properties

    public Point EndLocation
    {
      get
      {
        int x;
        int y;

        switch (this.Orientation)
        {
          case SegmentOrientation.Vertical:
            x = this.Location.X;
            y = this.Location.Y + this.Size;
            break;
          default:
            x = this.Location.X + this.Size;
            y = this.Location.Y;
            break;
        }

        return new Point(x, y);
      }
    }

    public Point Location { get; set; }

    public SegmentOrientation Orientation { get; set; }

    public int Size { get; set; }

    #endregion
  }
}

Donate

Donate