Ejemplo n.º 1
0
        private void showQuestion(Object source, ElapsedEventArgs e)
        {
            props.Question actual = GC.GetQuestion();
            this.Dispatcher.Invoke(() =>
            {
                ActualPrize.Text = "0 Kc";
                query.Text       = actual.Query;
            });

            questionsList = new List <string>(GC.ShuffleAnswers(GC.GetQuestion().answers));
            rightAnswer   = questionsList.IndexOf(actual.answers[0]);
            this.Dispatcher.Invoke(() =>
            {
                for (int i = 0; i < 4; i++)
                {
                    switch (i)
                    {
                    case 0: answerAText.Text = "A: " + questionsList[i]; break;

                    case 1: answerBText.Text = "B: " + questionsList[i]; break;

                    case 2: answerCText.Text = "C: " + questionsList[i]; break;

                    case 3: answerDText.Text = "D: " + questionsList[i]; break;
                    }
                }
            });

            this.Dispatcher.Invoke(() =>
            {
                mc.playQuestionBG(GC.Level);
                ListViewItem item = vyhry.ItemContainerGenerator.ContainerFromIndex(15 - GC.Level) as ListViewItem;
                item.Focus();
            });
        }
Ejemplo n.º 2
0
        public void ShowQuestion()
        {
            props.Question actual = GC.GetQuestion();
            ActualPrize.Text = GC.prizes[16 - GC.Level].Value;
            query.Text       = actual.Query;

            ListViewItem item = vyhry.ItemContainerGenerator.ContainerFromIndex(15 - GC.Level) as ListViewItem;

            item.Focus();


            questionsList = new List <string>(GC.ShuffleAnswers(GC.GetQuestion().answers));
            rightAnswer   = questionsList.IndexOf(actual.answers[0]);

            for (int i = 0; i < 4; i++)
            {
                switch (i)
                {
                case 0: answerAText.Text = "A: " + questionsList[i]; break;

                case 1: answerBText.Text = "B: " + questionsList[i]; break;

                case 2: answerCText.Text = "C: " + questionsList[i]; break;

                case 3: answerDText.Text = "D: " + questionsList[i]; break;
                }
            }

            this.Dispatcher.Invoke(() =>
            {
                mc.stop();
            });
            this.Dispatcher.Invoke(() =>
            {
                mc.playQuestionBG(GC.Level);
            });
        }