Esempio n. 1
0
 public void AddMatch(TournMatch match)
 {
     Matches.AddMatch(match);
     CurrentRound = Matches.Count == 0 ? 0 : Matches.Max(m => m.Round);
 }
Esempio n. 2
0
 private ITournMatchArray GetMatches()
 {
     if (this.rdoAllMatches.Checked)
     {
         ITournMatchArray byRound         = this.TargetTournament.Matches.GetByRound(this.Round);
         ITournMatchArray tournMatchArray = (ITournMatchArray) new TournMatchArray();
         foreach (ITournMatch match in (IEnumerable <ITournMatch>)byRound)
         {
             if (match.Players.FindById(Player.BYE_ID) == null)
             {
                 tournMatchArray.AddMatch(match);
             }
         }
         return(tournMatchArray);
     }
     try
     {
         TournMatchArray tournMatchArray = new TournMatchArray();
         char[]          separator       = new char[1] {
             '-'
         };
         string[] strArray1 = this.txtSpecificMatches.Text.Split(new char[1]
         {
             ','
         }, StringSplitOptions.RemoveEmptyEntries);
         if (strArray1.Length == 0)
         {
             return((ITournMatchArray)tournMatchArray);
         }
         foreach (string str in strArray1)
         {
             string[] strArray2 = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
             if (strArray2.Length != 0)
             {
                 int result1 = 0;
                 int result2 = 0;
                 if (!int.TryParse(strArray2[0], out result1))
                 {
                     throw new Exception("Invalid print range");
                 }
                 if (strArray2.Length >= 2)
                 {
                     int.TryParse(strArray2[1], out result2);
                 }
                 int table = result1;
                 do
                 {
                     ITournMatch byRoundTable = this.TargetTournament.Matches.GetByRoundTable(this.Round, table);
                     if (byRoundTable != null)
                     {
                         tournMatchArray.AddMatch(byRoundTable);
                     }
                     ++table;
                 }while (table <= result2);
             }
         }
         return((ITournMatchArray)tournMatchArray);
     }
     catch (Exception ex)
     {
     }
     return((ITournMatchArray) new TournMatchArray());
 }