Exemple #1
0
 private void selectOpt()
 {
     switch(curOpt)
     {
         case opt.play1:
             App.joyDown -= new EventHandler<JoyDownArgs>(start_joyDown);
             SetupWindow setup1 = new SetupWindow(false);
             App.Current.MainWindow = setup1;
             setup1.Show();
             this.Close();
             break;
         case opt.play2:
             App.joyDown -= new EventHandler<JoyDownArgs>(start_joyDown);
             SetupWindow setup2 = new SetupWindow(true);
             App.Current.MainWindow = setup2;
             setup2.Show();
             this.Close();
             break;
         case opt.viewHigh:
             App.joyDown -= new EventHandler<JoyDownArgs>(start_joyDown);
             ScoreboardWindow scoreboard = new ScoreboardWindow();
             App.Current.MainWindow = scoreboard;
             scoreboard.Show();
             this.Close();
             break;
         case opt.exitGame:
             System.Environment.Exit(0);
             break;
     }
 }
 private void selectOpt()
 {
     switch (curOpt)
     {
         case opt.returnStart:
             App.joyDown -= new EventHandler<JoyDownArgs>(score_joyDown);
             StartWindow start = new StartWindow();
             App.Current.MainWindow = start;
             start.Show();
             this.Close();
             break;
         case opt.clearScores:
             this.confirmNo.Visibility = Visibility.Visible;
             this.confirmYes.Visibility = Visibility.Visible;
             this.confirmAsk.Visibility = Visibility.Visible;
             this.returnStart.Visibility = Visibility.Collapsed;
             this.clearScores.Visibility = Visibility.Collapsed;
             updateFont(opt.confirmNo);
             break;
         case opt.confirmYes:
             scoreboardContext.resetBoard();
             App.joyDown -= new EventHandler<JoyDownArgs>(score_joyDown);
             ScoreboardWindow score = new ScoreboardWindow();
             App.Current.MainWindow = score;
             score.Show();
             this.Close();
             break;
         case opt.confirmNo:
             this.confirmNo.Visibility = Visibility.Collapsed;
             this.confirmYes.Visibility = Visibility.Collapsed;
             this.confirmAsk.Visibility = Visibility.Collapsed;
             this.returnStart.Visibility = Visibility.Visible;
             this.clearScores.Visibility = Visibility.Visible;
             updateFont(opt.clearScores);
             break;
     }
 }