Exemplo n.º 1
0
        private void btnNewGame_Click(object sender, RoutedEventArgs e)
        {
            EnableUnenableRDB(true);

            BoardChess.ResetBoardChess();

            for (int i = 0; i < MAX_SQUARE; i++)
            {
                for (int j = 0; j < MAX_SQUARE; j++)
                {
                    LButton[i, j].Content = "";

                    if ((i % 2 == 0 && j % 2 != 0) || (i % 2 != 0 && j % 2 == 0))
                    {
                        LButton[i, j].Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#E0E0E0"));
                    }
                    else
                    {
                        LButton[i, j].Background = Brushes.White;
                    }
                }
            }

            // Ket noi lai toi server
            //BoardChess.Socket.NewGame();
        }