Exemple #1
0
        void MainWindow_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Left:
                if (Timer.IsEnabled)
                {
                    myBoard.CurrentElementMoveLeft();
                }
                break;

            case Key.Right:
                if (Timer.IsEnabled)
                {
                    myBoard.CurrentElementMoveRight();
                }
                break;

            case Key.Down:
                if (Timer.IsEnabled)
                {
                    myBoard.CurrentElementMoveDown();
                }
                break;

            default:
                break;
            }
        }