Esempio n. 1
0
        private void HandleMouseDown(CanvasData canvasData, Point clickCoordinates)
        {
            InputMode inputMode = InputMode.SingleLeftClick;

            if ((ModifierKeys == Keys.Control))
            {
                inputMode = InputMode.CtrlPressed;
            }

            canvasData = GetBehaviorAndCanvasData(canvasData, clickCoordinates, inputMode);
            CommandsList.GetCommand(canvasData).Change(canvasData);
            this.canvasData = canvasData;
        }
Esempio n. 2
0
        private void HandleMouseMove(CanvasData canvasData, Point clickCoordinates)
        {
            if (canvasData.behaviourMode == BehaviourMode.VertexMove)
            {
                canvasData.clickCoordinates = clickCoordinates;
                CommandsList.GetCommand(canvasData).Change(canvasData);
            }
            else if (canvasData.behaviourMode == BehaviourMode.PolygonMove)
            {
                canvasData.moveCoordinates = clickCoordinates;
                CommandsList.GetCommand(canvasData).Change(canvasData);
            }

            this.canvasData = canvasData;
        }
 public void RegisterCommand_Correctly()
 {
     _commands.AddCommand(_fakeCommand);
     _commands.GetCommand("someCommand").IsSuccess.Should().Be(true);
     _commands.GetCommand("someCommand").Value.Should().Be(_fakeCommand);
 }