Ejemplo n.º 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            List <string> questionWithAnswersList = new List <string>();

            questionWithAnswersList = _mainForm.handleRecievedMessage(_mainForm.TriviaServerConnection.ReceiveFromServer());

            Form1        f            = _mainForm as Form1;
            QuestionForm questionForm = new QuestionForm(ref f, questionWithAnswersList, _numOfQuestionsAndQuestionTime[1].ToString(), _numOfQuestionsAndQuestionTime[0].ToString());

            questionForm.NameOfUser.Text = NameOfUser.Text;
            questionForm.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            _mainForm._gameStarted = true;

            List <string> questionAndAnswers = new List <string>();
            List <string> Users = new List <string>();

            _mainForm.TriviaServerConnection.SendToServer(_mainForm.MyProtocol.StartGame());
            //Users = _mainForm.handleRecievedMessage(_mainForm.TriviaServerConnection.ReceiveFromServer());
            questionAndAnswers = _mainForm.handleRecievedMessage(_mainForm.TriviaServerConnection.ReceiveFromServer());

            Form1        f            = _mainForm as Form1;
            QuestionForm questionForm = new QuestionForm(ref f, questionAndAnswers, _timeForAnswer, _numOfQuestions);

            questionForm.NameOfUser.Text = NameOfUser.Text;
            questionForm.Show();
            this.Hide();
        }