private void enableDisableButtonsComputerTurn(bool i_EnableDisable) { MemoryGameButton button; foreach (Control c in Controls) { button = c as MemoryGameButton; if (button != null) { if (i_EnableDisable == true) { if (MemoryBoard.IsOpen(button.Row, button.Col) == false) { button.Click += MemoryGameButton_Click; } } else { if (MemoryBoard.IsOpen(button.Row, button.Col) == false) { button.Click -= MemoryGameButton_Click; } } } } }
private void enableDisableButtonsPvPTurn(bool i_EnableDisable) { MemoryGameButton button; foreach (Control c in Controls) { button = c as MemoryGameButton; if (button != null) { if (c != FirstChoiceButton && c != SecondChoiceButton && MemoryBoard.IsOpen(button.Row, button.Col) == false) { c.Enabled = i_EnableDisable; } } } }