Exemplo n.º 1
0
 public void TakeOfAction(DrawingAction act)
 {
     if (!_drawingActions.Remove(act))
     {
         throw new KeyNotFoundException("Drawing Action in Drawing Model");
     }
 }
Exemplo n.º 2
0
 private void Draw(DrawingAction act)
 {
     if (act.Mode == DrawingTools.Pencil)
     {
         _drawingControl.DrawLine(act.LeftTop.X, act.LeftTop.Y, act.RightBottom.X, act.RightBottom.Y);
     }
 }
Exemplo n.º 3
0
 private void EnterCommander(DrawingTools mode, DrawingAction act)
 {
     if (mode == DrawingTools.Pencil)
     {
         _commander.Execute(new PencilCommand(this, act));
     }
 }
Exemplo n.º 4
0
        public void SetPointUp(double x, double y)
        {
            _Clicked    = false;
            _finalPoint = new Point(x, y);
            DrawingAction act = MakeAction(this._mode, _firstPoint, _finalPoint);

            EnterCommander(act.Mode, act);
            Refresh();
        }
Exemplo n.º 5
0
        private DrawingAction MakeAction(DrawingTools mode, Point leftTop, Point rightBottom)
        {
            DrawingAction act = new DrawingAction(DrawingTools.None, _firstPoint, _finalPoint);

            if (mode == DrawingTools.Pencil)
            {
                act = new DrawingAction(mode, leftTop, rightBottom);
            }
            return(act);
        }
Exemplo n.º 6
0
        public void SetPointMove(double x, double y)
        {
            if (_Clicked == false || _mode == DrawingTools.None)
            {
                return;
            }
            // Console.WriteLine("Move at {0:F} {1:F}", x, y);
            Refresh();
            _movePoint = new Point(x, y);
            DrawingAction act = MakeAction(this._mode, _firstPoint, _movePoint);

            Draw(act);
            //State.Move(_firstPoint,_movePoint)
        }
Exemplo n.º 7
0
 public void AddAnAction(DrawingAction act)
 {
     _drawingActions.Add(act);
 }