예제 #1
0
    protected void OnStartButtonClicked(object sender, EventArgs e)
    {
        if(qc == null)
            return;

        qc = new QuizConductor(cp.SelectedCategories);
        qw = new QuizWindow(qc);
        qw.Show();
    }
예제 #2
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();
 }
예제 #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();
 }
예제 #4
0
    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);
    }