/// <summary> /// Sets the direction of grid sweep /// </summary> /// <param name="direction">direction of sweep</param> public void SetGridSweepDirection(GridSweepDirections direction) { _gridSweepDirection = direction; switch (direction) { case GridSweepDirections.LeftRight: _gridStartPoint.X = 0; _gridStartPoint.Y = 0; _gridEndPoint.X = 0; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.RightLeft: _gridStartPoint.X = _boundWidth - 1; _gridStartPoint.Y = 0; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.TopDown: _gridStartPoint.X = 0; _gridStartPoint.Y = 0; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = 0; break; case GridSweepDirections.BottomUp: _gridStartPoint.X = 0; _gridStartPoint.Y = _boundHeight - 1; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; } }
/// <summary> /// Creates a pen and initializes grid coordinates /// </summary> private void initGridLine() { createPen(_gridPenColor, LineWidth); _gridStartPoint = new Point(0, 0); _gridEndPoint = new Point(0, _boundHeight); _gridMouseMoveDirection = GridMouseMoveDirections.AtoB; _gridSweepDirection = GridSweepDirections.LeftRight; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = GridOriginX; _gridEndPoint.Y = _boundHeight - 1; }
/// <summary> /// Toggles the direction of grid sweep /// </summary> /// <returns>new direction</returns> public GridSweepDirections ToggleGridSweepDirection() { var direction = _gridSweepDirection; switch (direction) { case GridSweepDirections.BottomUp: direction = GridSweepDirections.LeftRight; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = GridOriginX; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.LeftRight: direction = GridSweepDirections.RightLeft; _gridStartPoint.X = _boundWidth - 1; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.RightLeft: direction = GridSweepDirections.TopDown; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = GridOriginY; break; case GridSweepDirections.TopDown: direction = GridSweepDirections.BottomUp; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = _boundHeight - 1; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; } _gridSweepDirection = direction; return(direction); }
/// <summary> /// Creates a pen and initializes grid coordinates /// </summary> private void initGridLine() { createPen(_gridPenColor, LineWidth); _gridStartPoint = new Point(0, 0); _gridEndPoint = new Point(0, _boundHeight); _gridMouseMoveDirection = GridMouseMoveDirections.AtoB; _gridSweepDirection = GridSweepDirections.LeftRight; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = GridOriginX; _gridEndPoint.Y = _boundHeight - 1; }
/// <summary> /// Toggles the direction of grid sweep /// </summary> /// <returns>new direction</returns> public GridSweepDirections ToggleGridSweepDirection() { var direction = _gridSweepDirection; switch (direction) { case GridSweepDirections.BottomUp: direction = GridSweepDirections.LeftRight; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = GridOriginX; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.LeftRight: direction = GridSweepDirections.RightLeft; _gridStartPoint.X = _boundWidth - 1; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.RightLeft: direction = GridSweepDirections.TopDown; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = GridOriginY; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = GridOriginY; break; case GridSweepDirections.TopDown: direction = GridSweepDirections.BottomUp; _gridStartPoint.X = GridOriginX; _gridStartPoint.Y = _boundHeight - 1; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; } _gridSweepDirection = direction; return direction; }
/// <summary> /// Sets the direction of grid sweep /// </summary> /// <param name="direction">direction of sweep</param> public void SetGridSweepDirection(GridSweepDirections direction) { _gridSweepDirection = direction; switch (direction) { case GridSweepDirections.LeftRight: _gridStartPoint.X = 0; _gridStartPoint.Y = 0; _gridEndPoint.X = 0; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.RightLeft: _gridStartPoint.X = _boundWidth - 1; _gridStartPoint.Y = 0; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; case GridSweepDirections.TopDown: _gridStartPoint.X = 0; _gridStartPoint.Y = 0; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = 0; break; case GridSweepDirections.BottomUp: _gridStartPoint.X = 0; _gridStartPoint.Y = _boundHeight - 1; _gridEndPoint.X = _boundWidth - 1; _gridEndPoint.Y = _boundHeight - 1; break; } }