コード例 #1
0
        private void BackButton_Click(object sender, RoutedEventArgs e)
        {
            Round1Menu r1m = new Round1Menu(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2);

            r1m.Show();
            this.Hide();
        }
コード例 #2
0
 public void newQuestion()
 {
     while (true)
     {
         linklistop linklistnode = new linklistop();
         ptr     = new Node();
         tempptr = ptr;
         if (category == "General Knowledge")
         {
             ptr = generalknowledgeround1.returnquestionround1(ptr);
             //generalknowledgeround1.show();
         }
         else if (category == "Islamic Studies")
         {
             ptr = islamicstudiesround1.returnquestionround1(ptr);
         }
         else if (category == "History")
         {
             ptr = historyround1.returnquestionround1(ptr);
         }
         else if (category == "Geography")
         {
             ptr = geographyround1.returnquestionround1(ptr);
         }
         else if (category == "Sports")
         {
             ptr = sportsround1.returnquestionround1(ptr);
         }
         else if (category == "Entertainment")
         {
             ptr = entertainmentround1.returnquestionround1(ptr);
         }
         else if (category == "Literature")
         {
             ptr = literatureround1.returnquestionround1(ptr);
         }
         if (ptr == null)
         {
             MessageBox.Show("No more questions left from this category");
             Round1Menu r1m = new Round1Menu(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2);
             this.Hide();
             r1m.Show();
             //category = randomQuestion();
         }
         else
         {
             this.TimerTextBlock.Text = String.Empty;
             _timesCalled             = 0;
             dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
             dispatcherTimer.Start();
             ptr.asked = true;
             this.QuestionTextBlock.Text = ptr.question;
             this.OptionATextBlock.Text  = "A)" + ptr.optionA;
             this.OptionBTextBlock.Text  = "B)" + ptr.optionB;
             this.OptionCTextBlock.Text  = "C)" + ptr.optionC;
             this.OptionDTextBlock.Text  = "D)" + ptr.optionD;
             if (ptr.imgpath != String.Empty)
             {
                 this.Questionimage.Stretch = Stretch.Uniform;
                 this.Questionimage.Source  = new BitmapImage(new Uri(ptr.imgpath));
             }
             return;
         }
     }
 }