Example #1
0
        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);
        }
Example #2
0
        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);
        }