public Round1Menu(linklistop gk, linklistop lit, linklistop isl, linklistop sp, linklistop geo, linklistop his, linklistop enter, linklistop round2list)
        {
            InitializeComponent();
            generalknowledgeround1 = gk;
            literatureround1       = lit;
            islamicstudiesround1   = isl;
            sportsround1           = sp;
            geographyround1        = geo;
            historyround1          = his;
            entertainmentround1    = enter;

            generallistround2 = round2list;
        }
예제 #2
0
        public Round2Form(linklistop gk, linklistop lit, linklistop isl, linklistop sp, linklistop geo, linklistop his, linklistop enter, linklistop round2list)
        {
            InitializeComponent();
            generalknowledgeround1 = gk;
            literatureround1       = lit;
            islamicstudiesround1   = isl;
            sportsround1           = sp;
            geographyround1        = geo;
            historyround1          = his;
            entertainmentround1    = enter;

            generallistround2 = round2list;
            ptr                   = new Node();
            tempptr               = new Node();
            dispatcherTimer       = new DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
        }
 public Round1Form(linklistop gk, linklistop lit, linklistop isl, linklistop sp, linklistop geo, linklistop his, linklistop enter, linklistop round2list, String categroylocal)
 {
     InitializeComponent();
     _timesCalled           = 0;
     generalknowledgeround1 = gk;
     literatureround1       = lit;
     islamicstudiesround1   = isl;
     sportsround1           = sp;
     geographyround1        = geo;
     historyround1          = his;
     entertainmentround1    = enter;
     dispatcherTimer        = new DispatcherTimer();
     dispatcherTimer.Tick  += new EventHandler(dispatcherTimer_Tick);
     generallistround2      = round2list;
     category = categroylocal;
     ptr      = new Node();
     tempptr  = new Node();
     newQuestion();
 }
        public MainMenu(String Dir)
        {
            InitializeComponent();
            dir = Dir;
            generalknowledgeround1 = new linklistop();
            literatureround1       = new linklistop();
            islamicstudiesround1   = new linklistop();
            sportsround1           = new linklistop();
            geographyround1        = new linklistop();
            historyround1          = new linklistop();
            entertainmentround1    = new linklistop();

            generallistround2 = new linklistop();
            generalknowledgeround1.fillthelinklist(dir, "GeneralKnowledge");
            sportsround1.fillthelinklist(dir, "Sports");
            literatureround1.fillthelinklist(dir, "Literature");
            islamicstudiesround1.fillthelinklist(dir, "Islamiat");
            geographyround1.fillthelinklist(dir, "Geography");
            historyround1.fillthelinklist(dir, "History");
            entertainmentround1.fillthelinklist(dir, "Entertainment");

            generallistround2.fillround2(dir);
        }
        public String randomQuestion()
        {
            clearQuestionAnswer(ptr);
            //DispatcherTimer dispatcherTimer = new DispatcherTimer();
            //dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            //_timesCalled = 0;
            //dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            //dispatcherTimer.Start();
            linklistop linklistnode = new linklistop();

            ptr = new Node();
            Random rand = new Random();
            int    num  = 0;

            while (true)
            {
                num      = rand.Next(1, 8);
                category = String.Empty;
                if (num == 1)
                {
                    category = "General Knowledge";
                    break;
                    //Round1Form r1cs = new Round1Form(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2, category);
                    //this.Hide();
                    //r1cs.Show();
                }
                else if (num == 2)
                {
                    category = "Islamic Studies";
                    break;
                    //Round1Form r1cs = new Round1Form(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2, category);
                    //this.Hide();
                    //r1cs.Show();
                }
                else if (num == 3)
                {
                    category = "History";
                    break;
                    //Round1Form r1cs = new Round1Form(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2, category);
                    //this.Hide();
                    //r1cs.Show();
                }
                else if (num == 4)
                {
                    category = "Sports";
                    break;
                    //Round1Form r1cs = new Round1Form(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2, category);
                    //this.Hide();
                    //r1cs.Show();
                }
                else if (num == 5)
                {
                    category = "Entertainment";
                    break;
                    //Round1Form r1cs = new Round1Form(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2, category);
                    //this.Hide();
                    //r1cs.Show();
                }
                else if (num == 6)
                {
                    category = "Geography";
                    break;
                    //Round1Form r1cs = new Round1Form(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2, category);
                    //this.Hide();
                    //r1cs.Show();
                }
                else if (num == 7)
                {
                    category = "Literature";
                    break;
                    //Round1Form r1cs = new Round1Form(generalknowledgeround1, literatureround1, islamicstudiesround1, sportsround1, geographyround1, historyround1, entertainmentround1, generallistround2, category);
                    //this.Hide();
                    //r1cs.Show();
                }
            }
            return(category);
            //newQuestion();
        }
 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;
         }
     }
 }