Exemple #1
0
        private void Submit_Click(object sender, RoutedEventArgs e)
        {
            PlayerCreator pc = new PlayerCreator();
            int           id, elo;
            string        name;

            try
            {
                id   = int.Parse(IDBox.Text);
                name = NameBox.Text;
                elo  = int.Parse(ELOBox.Text);

                Player player = new Player(id, name, elo);
                MainWindow.PlayerList.Add(player);
                MessageBox.Show("Submitted!");
                this.Close();
                pc.Close();
            }
            catch (FormatException EXC)
            {
                MessageBox.Show("Wrong input data type!");
            }
        }
Exemple #2
0
        private void AddPlayer_Click(object sender, RoutedEventArgs e)
        {
            PlayerCreator pc = new PlayerCreator();

            pc.Show();
        }