예제 #1
0
        public void DragOver(MathTask task)
        {
            var selectedSquare    = board[selectedMathTask.Row, selectedMathTask.Col];
            var destinationSquare = board[task.Row, task.Col];

            var indexOfSelectedSquare    = Squares.IndexOf(selectedSquare);
            var indexOfDestinationSquare = Squares.IndexOf(destinationSquare);

            var newSelectedSquare = new Square(
                selectedSquare.Row,
                selectedSquare.Col,
                selectedSquare.Color,
                new Empty(selectedSquare.Row, selectedSquare.Col));

            Squares[indexOfSelectedSquare] = newSelectedSquare;

            selectedMathTask.Row = destinationSquare.Row;
            selectedMathTask.Col = destinationSquare.Col;

            var newDestinationSwuare = new Square(
                destinationSquare.Row,
                destinationSquare.Col,
                destinationSquare.Color,
                selectedMathTask);

            Squares[indexOfDestinationSquare] = newDestinationSwuare;

            this.board[selectedSquare.Row, selectedSquare.Col]       = newSelectedSquare;
            this.board[destinationSquare.Row, destinationSquare.Col] = newDestinationSwuare;

            Task.Run(() =>
            {
                MessageBox.Show(task.ToString());
            });
        }
예제 #2
0
 public void DragInit(MathTask task)
 {
     Task.Run(() =>
     {
         MessageBox.Show(task.ToString());
     });
 }