Exemplo n.º 1
0
        /// <summary>
        /// The user selected an answer.
        /// Set the flags, menu entry colors, and start timer.
        /// </summary>
        private void AnswerSelected(bool correctAnswer, FlashCard selectedAnswer)
        {
            QuestionStateMachine.Done();

            if (!AnswerChosen)
            {
                //set flags
                AnswerChosen    = true;
                AnsweredCorrect = correctAnswer;

                //Set all the colors of the answers to let the user know which was the correct answer
                foreach (var entry in Entries)
                {
                    entry.QuestionAnswered = true;
                }

                if (null != QuestionAnswered)
                {
                    QuestionAnswered(this, new QuestionEventArgs(AnsweredCorrect, correctQuestion, selectedAnswer));
                }

                //start the timer to exit this screen
                AutoQuit.Start(1f);

                if (null != OverlayScreen)
                {
                    OverlayScreen.ExitScreen();
                }
            }
        }
Exemplo n.º 2
0
 public override void ExitScreen()
 {
     base.ExitScreen();
     if (null != OverlayScreen)
     {
         OverlayScreen.ExitScreen();
     }
 }
Exemplo n.º 3
0
        public override void UnloadContent()
        {
            base.UnloadContent();

            if (null != OverlayScreen)
            {
                OverlayScreen.ExitScreen();
            }

            if (null != soundContent)
            {
                soundContent.Unload();
                soundContent.Dispose();
                soundContent = null;
            }
        }