ANRTournament.MainWindow.btnPlayerAdd_Click C# (CSharp) 메소드

btnPlayerAdd_Click() 개인적인 메소드

private btnPlayerAdd_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
리턴 void
        private void btnPlayerAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {

                Player playerToAdd = new Player() { Place = this.tournament.PointsTable.Count + 1 };

                bool added = false;
                while (!added)
                {
                    PlayerWindow frmPlayer = new PlayerWindow(playerToAdd) { Owner = this };
                    if (frmPlayer.ShowDialog() == true)
                    {
                        if (this.tournament.PointsTable.Where(p => p.Alias == playerToAdd.Alias).Count() > 0)
                        {
                            new PMW(StringTable.MainWindow_PlayerExists);
                            continue;
                        }

                        this.tournament.AddPlayer(playerToAdd);
                        added = true;
                        continue;
                    }
                    else
                    {
                        added = true;
                        continue;
                    }
                }
            }
            catch (Exception ex)
            {
                new PME("Błąd dodawania gracza." + Environment.NewLine + ex.Message + Environment.NewLine + (ex.InnerException == null ? "" : ex.InnerException.Message));
            }
        }
MainWindow