protected void DisqualifyPlayer_Click(object sender, EventArgs e) { if (selectedPlayer >= 0) { Player player = activeTournament.GetPlayerByNr(selectedPlayer); if (io.ShowMessageWithOKCancel("Der Spieler " + player.DisplayName + " soll disqualifiziert werden? Dies kann nicht Rückgängig gemacht werden!")) { activeTournament.DisqualifyPlayer(player); activeTournament.Sort(); RefreshDataGridPlayer(activeTournament.Participants); RefreshDataGridPairings(activeTournament.Pairings); } } }
private void Load(bool autosave = false) { int response; bool overwrite = true; string filename = ""; for (int i = 3; i < vbuttonboxRounds.Children.Length; i++) { vbuttonboxRounds.Remove(vbuttonboxRounds.Children [i]); } if (autosave) { AutosaveDialog ad = new AutosaveDialog(io); ad.Run(); overwrite = ad.Result; filename = ad.FileName; ad.Destroy(); } else { if (activeTournament != null) { if (!io.ShowMessageWithOKCancel("Das aktuelle Turnier wird überschrieben.")) { overwrite = false; } } } if (overwrite == true) { activeTournament = io.Load(filename); //Load Actions if (activeTournament != null) { for (int i = 1; i <= activeTournament.Rounds.Count; i++) { AddRoundButton(i); } } if (activeTournament.FirstRound && (activeTournament.Rounds == null || activeTournament.Rounds.Count == 0)) { SetGUIState(true); } else { SetGUIState(false, true); } ButtonGetResults.Label = "Erg. übernehmen"; ButtonGetResults.Sensitive = activeTournament.ButtonGetResultState == true; ButtonNextRound.Sensitive = activeTournament.ButtonNextRoundState == true; ButtonCut.Sensitive = activeTournament.ButtonCutState == true; activeTournament.Sort(); RefreshDataGridPlayer(activeTournament.Participants); if (activeTournament.Pairings != null) { RefreshDataGridPairings(activeTournament.Pairings); } selectedPlayer = -1; SetIO(); } }