protected void OnStartButtonClicked(object sender, EventArgs e)
    {
        if(qc == null)
            return;

        qc = new QuizConductor(cp.SelectedCategories);
        qw = new QuizWindow(qc);
        qw.Show();
    }
 public QuizWindow(QuizConductor conductor)
     : base(Gtk.WindowType.Toplevel)
 {
     this.Build();
     this.conductor = conductor;
     this.startTime = DateTime.Now;
     this.updateTitleTimer = new Timer(20000); // 20 s, so that we won't miss the actual change by much
     this.updateTitleTimer.Elapsed += OnTitleUpdateTimer;
     this.updateTitleTimer.Start();
     GoToNextQuestion();
 }
Exemple #3
0
 public QuizWindow(QuizConductor conductor) :
     base(Gtk.WindowType.Toplevel)
 {
     this.Build();
     this.conductor                 = conductor;
     this.startTime                 = DateTime.Now;
     this.updateTitleTimer          = new Timer(20000);    // 20 s, so that we won't miss the actual change by much
     this.updateTitleTimer.Elapsed += OnTitleUpdateTimer;
     this.updateTitleTimer.Start();
     GoToNextQuestion();
 }
    protected void OnOpenQuizFileButtonClicked(object sender, EventArgs e)
    {
        string quizPath = AskForQuizFilePath();
        Console.WriteLine("Reading quiz from " + quizPath);
        using(StreamReader quizStream = new StreamReader(quizPath))
        {
            string basePath = System.IO.Path.GetDirectoryName(quizPath);
            qc = new QuizConductor(quizStream, basePath);
        }

        cp = new CategoryPicker(treeview1, qc.Categories);
    }