Beispiel #1
0
 void getQuestionWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     if (_currentQuestion != null) Thread.Sleep(700);
     Question question=null;
     while(question==null)
         try
         {
             question = QuizDB.CreateNewQuestion();
         }
         catch (Exception ex)
         {
             Debug.WriteLine(ex.Message);
         }
     this.Dispatcher.Invoke(new Action(()=>this._currentQuestion = new QuestionVM(question)));
 }
Beispiel #2
0
        void getQuestionWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (_currentQuestion != null)
            {
                Thread.Sleep(700);
            }
            Question question = null;

            while (question == null)
            {
                try
                {
                    question = QuizDB.CreateNewQuestion();
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            }
            this.Dispatcher.Invoke(new Action(() => this._currentQuestion = new QuestionVM(question)));
        }