private void btnOK_Click(object sender, EventArgs e)
        {
            string ID = GetPlayerID(cmbName.Text);
            if (ID == null)
            {
                if (MessageBox.Show("\"" + cmbName.Text + "\" appears to be a new player. Add them now?", "New Player",
                    MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) == DialogResult.No)
                    return;
                using (var dialog = new frmCreatePlayer(cmbName.Text))
                {
                    if (dialog.ShowDialog() == DialogResult.Cancel) return;

                    var record = new PlayerRecord();
                    record.FirstName = dialog.FirstName;
                    record.LastName = dialog.LastName;
                    if (dialog.AdditionalInformation)
                    {
                        record.ForumName = dialog.ForumName;
                        record.Email = dialog.Email;
                        record.Hometown = dialog.Hometown;
                        record.Region = dialog.PlayerRegion;
                        record.Faction = dialog.Faction;
                    }

                    Config.Settings.Players.Add(record);
                    Config.Settings.SavePlayers();
                    ID = GetPlayerID(cmbName.Text);

                    cmbName.Items.Add(record.Name);
                }
            }

            LeagueResultsEventArgs results = new LeagueResultsEventArgs(ID);

            foreach (ListViewItem item in lstAchievements.Items)
            {
                if (item.SubItems[2].Text != "0")
                {
                    Achievement achievement = ((Achievement)item.Tag).Clone();
                    achievement.Earned = Convert.ToInt32(item.SubItems[2].Text);
                    results.MatchResult.Achievements.Add(achievement);
                }
            }

            int myVPs = Convert.ToInt32(txtVPs.Text);
            int theirVPs = Convert.ToInt32(txtOpponentVPs.Text);

            results.MatchResult.VictoryPoints = myVPs;
            results.MatchResult.TournamentPoints = myVPs > theirVPs ? 3 : myVPs == theirVPs ? 1 : 0;
            results.MatchResult.Differential = myVPs - theirVPs;
            results.MatchResult.DatePlayed = DateTime.Now;

            if (LeagueResultsEnteredCallback != null) LeagueResultsEnteredCallback(this, results);

            if (chkContinuousAdd.Checked)
            {
                foreach (ListViewItem item in lstAchievements.Items)
                    item.SubItems[2].Text = "0";
                txtVPs.Text = "0";
                txtOpponentVPs.Text = "0";
                cmbName.Text = "";
                cmbName.Focus();
            }
            else
                this.Close();

        }
 public void LeagueResultsEntered(object sender, LeagueResultsEventArgs e)
 {
     League.MatchesPlayed.Add(e.MatchResult);
     Config.Settings.SaveEvents();
     lstResults.Invoke(new MethodInvoker(delegate { UpdateScores(); }));
 }