public void RemovePlayer(int index, bool disqualify = false)
        {
            Player player = ActiveTournament.Participants[index];
            string text   = "remove";

            if (Started)
            {
                text = "drop";
            }
            else if (Started & disqualify)
            {
                text = "disqualify";
            }
            if (ActiveIO.ShowMessageWithOKCancel("Do you really want to " + text + " " + player.DisplayName + "?"))
            {
                if (text == "remove")
                {
                    ActiveTournament.RemovePlayer(player);
                }
                else if (text == "drop")
                {
                    ActiveTournament.DropPlayer(player);
                }
                else if (text == "disqualify")
                {
                    ActiveTournament.DisqualifyPlayer(player);
                }
            }
        }
        public List <Pairing> GetSeed(bool cut)
        {
            List <Pairing> temp = ActiveTournament.GetSeed(firststart, cut);

            firststart = false;
            return(temp);
        }
 public void NewPlayer(IPlayerDialog ipd)
 {
     ipd.ShowDialog();
     if (ipd.GetDialogResult())
     {
         ActiveTournament.AddPlayer(ipd.GetPlayer());
     }
 }
        public bool GetResults(List <Pairing> pairings, string buttonGetResultsText, bool CutIsEnabled, bool update = false, bool end = false)
        {
            if (update)
            {
                ActiveTournament.GetResults(pairings, true);
                return(true);
            }
            if (pairings.Count == 1)
            {
                end = true;
            }
            bool allResultsEdited = true;

            if (ActiveTournament.Rule.IsDrawPossible || ActiveTournament.bonus)
            {
                foreach (Pairing p in pairings)
                {
                    if (!p.ResultEdited)
                    {
                        allResultsEdited = false;
                        break;
                    }
                }
            }
            if (allResultsEdited)
            {
                if (CheckResults(pairings) || ActiveTournament.bonus)
                {
                    ActiveTournament.GetResults(pairings);
                }
                else
                {
                    ActiveIO.ShowMessage("One ore more results are invalid.");
                    return(false);
                }
            }
            else
            {
                ActiveIO.ShowMessage("There is a result missing.");
                return(false);
            }

            if (end)
            {
                if (!ActiveTournament.CutStarted)
                {
                    ActiveTournament.CalculateWonBye();
                }
                //DataGridPairing.Visibility = System.Windows.Visibility.Hidden;
                //ChangeGUIState(false, true);
            }
            else
            {
                //ChangeGUIState(false);
            }
            ActiveTournament.Sort();
            return(true);
        }
        public List <Pairing> ResetLastResults()
        {
            List <Pairing> pl = new List <Pairing>();

            foreach (var p in ActiveTournament.Rounds[ActiveTournament.Rounds.Count - 1].Pairings)
            {
                pl.Add(new Pairing(p)
                {
                    ResultEdited = true,
                });
            }
            ActiveTournament.RemoveLastRound();
            return(pl);
        }
 public List <Pairing> AwardBonusPoints()
 {
     return(ActiveTournament.GetBonusSeed());
 }
 public void CalculateWonByes()
 {
     ActiveTournament.CalculateWonBye();
 }
 public void RemovePlayer(Player p, bool disqualify = false)
 {
     RemovePlayer(ActiveTournament.GetIndexOfPlayer(p));
 }