Beispiel #1
0
        private void Down_Click(object sender, EventArgs e)
        {
            var command = new MoveDigraphCommand(digraph, 0, 10);

            commandsManager.Execute(command);
            UpdateImage();
        }
Beispiel #2
0
        /// <summary>
        /// Executes commands to move digraph itself
        /// </summary>
        private void MainWindow_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.ControlKey)
            {
                isControlPressed = false;
            }
            if (e.Modifiers != Keys.Control && sender != MouseWheelTimer)
            {
                return;
            }
            if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down ||
                e.KeyCode == Keys.Right || e.KeyCode == Keys.Left)
            {
                if (xCoefficient == 0 && yCoefficient == 0)
                {
                    return;
                }
                var command = new MoveDigraphCommand(digraph, xCoefficient, yCoefficient);
                commandsManager.Execute(command);
                xCoefficient = yCoefficient = 0;
            }

            if (e.KeyCode == Keys.OemMinus || e.KeyCode == Keys.Oemplus)
            {
                var command = new ResizeDigraphCommand(digraph, resizeCoefficient);
                commandsManager.Execute(command);
                resizeCoefficient = 1;
            }
        }