Beispiel #1
0
 private void newPlayerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     frmWelcomeScreen welcome = new frmWelcomeScreen();
     DialogResult res = welcome.ShowDialog();
     if (res == DialogResult.OK)
     {
         game = new Game(welcome.Player);
         lbl_player.Text = welcome.Player;
         StartNewGame();
     }
 }
Beispiel #2
0
        private void frmYamb_Shown(object sender, EventArgs e)
        {
            try
            {

                Serializer serializer = new Serializer();
                Highscore highscore = serializer.DeSerializeObject("db.dat");
                Highscore.GetInstance().Highscores = highscore.Highscores;
                Highscore.GetInstance().HighscoreTables = highscore.HighscoreTables;
            }
            catch (Exception)
            {
                MessageBox.Show("The application has no access to db.dat file or the file is corrupted!\nReinstall the program to a location where they are no administrator rights necessary.\neg.: C:\\");
                this.Close();
            }

            frmWelcomeScreen welcome = new frmWelcomeScreen();
            DialogResult res = welcome.ShowDialog();
            if (res == DialogResult.OK)
            {
                game = new Game(welcome.Player);
                lbl_player.Text = welcome.Player;
            }
            else
            {
                this.Close();
            }
        }