Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(textBox1.Text) && comboBox2.SelectedItem != null)
            {
                QuestionSet questionSet = client.RetrieveQuestionSetByTitle(comboBox2.Text);

                client.CreateGame2(new Game {
                    Name = textBox1.Text
                }, questionSet.Title, Int32.Parse(maskedTextBox1.Text));
                Game game = client.RetrieveGame(textBox1.Text, false);;

                client.AddPlayer(game);

                this.Hide();
                (new Lobby(game, client)).Show();
            }
            else
            {
                MessageBox.Show("All fields must be filled!", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }