private void NetworkNewGame(object sender, Business.NewGamePressedArgs e) { secretWord = e.SecretWord; pressedKeys.Clear(); //Invalidate(); if (this.InvokeRequired) { this.Invoke((MethodInvoker) delegate() { this.lblClientResult.Text = clientResult.ToString(); this.lblServerResult.Text = serverResult.ToString(); ui.DrawWord(this, secretWord); }); } else { ui.DrawWord(this, secretWord); } EnableKeyBoard(false); }
private void NewGame() { CFDB ENT = new CFDB(); var Sec = (from S in ENT.WordsGames where S.Difficulty == this.Difficulty && S.Category == this.category orderby Guid.NewGuid() select S.Word).FirstOrDefault(); secretWord = Sec; pressedKeys.Clear(); network.Send("newGame", secretWord); this.Invoke((MethodInvoker) delegate() { this.lblClientResult.Text = clientResult.ToString(); this.lblServerResult.Text = serverResult.ToString(); ui.DrawWord(this, secretWord); }); EnableKeyBoard(true); }