// MATCHES private void SetMatches() { SetMatchesDays(); var matches = AllMatches?.OrderBy(x => x.MatchTypeID).ThenBy(x => x.Time).Where(x => x.Time?.Date == MatchesDaySelected.Date); var matchesGroupList = new ObservableCollection <IGrouping <string, Match> >(matches?.GroupBy(x => x.MatchTypeName)); MatchesGroupList = matchesGroupList; }
public async Task GetMatches() { AllMatches = await GetDataStore().GetMatchesAsync("active", this); if (AdministratorLoggedIn.AdministratorTeamID == 0) { Matches = new ObservableCollection <Match>(AllMatches.Where(x => x.Time.Value.ToLocalTime().Date == DateTime.Now.ToLocalTime().Date)); } else { Matches = new ObservableCollection <Match>(AllMatches); } }
public Tournament(Tournament tournament) { Name = tournament.Name; Location = tournament.Location; Date = tournament.Date; foreach (var match in tournament.AllMatches) { Match newMatch = new Match(match); AllMatches.Add(newMatch); } TournamentId = tournament.TournamentId; }
// FIXTURES private void SetFixtures() { var fixturesCompetitions = new ObservableCollection <string>(); var fromDate = DateTime.Now.Date.AddDays(0); var toDate = DateTime.Now.Date.AddDays(360); var fixturesMatches = AllMatches?.OrderBy(x => x.MatchTypeID).ThenBy(x => x.Time).Where(x => x.Time > fromDate && x.Time < toDate && (x.StatusID < 12) || x.StatusID == 14) ?? new ObservableCollection <Match>(); foreach (IGrouping <string, Match> competitionMatches in fixturesMatches?.GroupBy(x => x.MatchTypeName)) { if (!string.IsNullOrEmpty(competitionMatches.Key)) { fixturesCompetitions.Add(competitionMatches.Key); } } FixturesCompetitions = new ObservableCollection <string>(fixturesCompetitions); if (string.IsNullOrEmpty(FixturesCompetitionSelected) && FixturesCompetitions.Count > 0) { FixturesCompetitionSelected = FixturesCompetitions.FirstOrDefault(); } var fixturesGroupList = fixturesMatches?.Where(x => x.MatchTypeName == FixturesCompetitionSelected).GroupBy(x => x.MatchTypeName); FixturesGroupList = new ObservableCollection <IGrouping <string, Match> >(fixturesGroupList); }
// RESULTS private void SetResults() { var resultsCompetitions = new ObservableCollection <string>(); var toDate = DateTime.Now.Date.AddDays(0); var fromDate = new DateTime(toDate.Year - 1, 12, 31); var resultsMatches = AllMatches?.OrderBy(x => x.MatchTypeID).ThenByDescending(x => x.Time).Where(x => x.Time > fromDate && x.Time < toDate || (x.StatusID == 13 || x.StatusID == 12)) ?? new ObservableCollection <Match>(); foreach (IGrouping <string, Match> competitionMatches in resultsMatches.GroupBy(x => x.MatchTypeName)) { if (!string.IsNullOrEmpty(competitionMatches.Key)) { resultsCompetitions.Add(competitionMatches.Key); } } ResultsCompetitions = new ObservableCollection <string>(resultsCompetitions); if (string.IsNullOrEmpty(ResultsCompetitionSelected) && ResultsCompetitions.Count > 0) { ResultsCompetitionSelected = ResultsCompetitions.FirstOrDefault(); } var resultsGroupList = resultsMatches?.Where(x => x.MatchTypeName == ResultsCompetitionSelected).GroupBy(x => x.MatchTypeName); ResultsGroupList = new ObservableCollection <IGrouping <string, Match> >(resultsGroupList); }
public void CheckForMatches() { Traversed.Clear(); AllMatches.Clear(); for (int y = 0; y < Board.Rows; y++) { for (int x = 0; x < Board.Columns; x++) { PuzzleOrb orb = GetOrbWithIndex(new Index2D(x, y)); if (Traversed.Contains(orb)) { continue; } List <List <PuzzleOrb> > matchGroup = new List <List <PuzzleOrb> >(); TraverseOrb(orb, matchGroup); if (matchGroup.Count > 0) { List <PuzzleOrb> matchedOrbs = new List <PuzzleOrb>(); for (int i = 0; i < matchGroup.Count; i++) { for (int j = 0; j < matchGroup[i].Count; j++) { if (!matchedOrbs.Contains(matchGroup[i][j])) { matchedOrbs.Add(matchGroup[i][j]); } } } AllMatches.Add(matchedOrbs); } } } }
// Module defining this command // Optional custom code for this activity /// <summary> /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. /// </summary> /// <param name="context">The NativeActivityContext for the currently running activity.</param> /// <returns>A populated instance of System.Management.Automation.PowerShell</returns> /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks> protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context) { System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create(); System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName); // Initialize the arguments if (InputObject.Expression != null) { targetCommand.AddParameter("InputObject", InputObject.Get(context)); } if (Pattern.Expression != null) { targetCommand.AddParameter("Pattern", Pattern.Get(context)); } if (Path.Expression != null) { targetCommand.AddParameter("Path", Path.Get(context)); } if (LiteralPath.Expression != null) { targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context)); } if (SimpleMatch.Expression != null) { targetCommand.AddParameter("SimpleMatch", SimpleMatch.Get(context)); } if (CaseSensitive.Expression != null) { targetCommand.AddParameter("CaseSensitive", CaseSensitive.Get(context)); } if (Quiet.Expression != null) { targetCommand.AddParameter("Quiet", Quiet.Get(context)); } if (List.Expression != null) { targetCommand.AddParameter("List", List.Get(context)); } if (Include.Expression != null) { targetCommand.AddParameter("Include", Include.Get(context)); } if (Exclude.Expression != null) { targetCommand.AddParameter("Exclude", Exclude.Get(context)); } if (NotMatch.Expression != null) { targetCommand.AddParameter("NotMatch", NotMatch.Get(context)); } if (AllMatches.Expression != null) { targetCommand.AddParameter("AllMatches", AllMatches.Get(context)); } if (Encoding.Expression != null) { targetCommand.AddParameter("Encoding", Encoding.Get(context)); } if (Context.Expression != null) { targetCommand.AddParameter("Context", Context.Get(context)); } return(new ActivityImplementationContext() { PowerShellInstance = invoker }); }
public static void AddMatch(TournamentGroupLogMatch match) { AllMatches.Add(match); }
public void ClearMatches() { AllMatches.Clear(); }