private void butClearHistory_Click(object sender, EventArgs e) { if (player != null) { player.hisElo.list.Clear(); player.SaveToIni(); int count = CModeTournamentP.tourList.DeletePlayer(player.name); MessageBox.Show($"{count} records have been deleted"); } }
void SaveToIni(CPlayer p) { p.name = tbPlayerName.Text; p.engine = cbEngineList.Text; p.book = cbBookList.Text; p.SetTournament((int)nudTournament.Value); p.elo = nudElo.Value.ToString(); p.eloOrg = p.elo; p.modeValue.mode = modeValue.mode; p.modeValue.value = modeValue.value; p.SaveToIni(); UpdateListBox(); int index = listBox1.FindString(p.name); if (index == -1) { return; } listBox1.SetSelected(index, true); }