/// <summary> /// Erstellt den Spielplan der Liga /// </summary> public void CreateMatches() { Matches.Clear(); switch (RoundMode) { case ELeagueRoundMode.SingleRound: int id = 0; for (int i = 0; i < Teams.Count; i++) { for (int j = i + 1; j < Teams.Count; j++) { Matches.Add(new FootballMatch(id++, Teams[i], Teams[j])); } } break; case ELeagueRoundMode.DoubleRound: foreach (var teamA in Teams) { foreach (var teamB in Teams) { if (teamA != teamB) { Matches.Add(new FootballMatch(Matches.Count, teamA, teamB)); } } } break; case ELeagueRoundMode.QuadrupleRound: foreach (var teamA in Teams) { foreach (var teamB in Teams) { if (teamA != teamB) { Matches.Add(new FootballMatch(Matches.Count, teamA, teamB)); } } } foreach (var teamA in Teams) { foreach (var teamB in Teams) { if (teamA != teamB) { Matches.Add(new FootballMatch(Matches.Count, teamA, teamB)); } } } break; } SimpleLog.Log(String.Format("Matches Created in Football League ID={0}", ID)); }
public override void Close() { _timer.Stop(); _timer.Tick -= Timer_Elapsed; Mediator.UnregisterRecipientAndIgnoreTags(this); Matches.Clear(); LineSr.UnsubscribeFromEnent(DataCopy_DataSqlUpdateSucceeded); base.Close(); }
private void ClearSearchResults(string obj) { SelectedSport = null; SelectedTournament = null; Sports = new ObservableCollection <ComboBoxItem>(); Tournaments = new ObservableCollection <ComboBoxItem>(); ChangeTracker.SearchString = ""; IsFocused = false; Matches.Clear(); }
protected void ChangeMatchCountTo(int count) { Matches.Clear(); while (Matches.Count < count) { Matches.Add(Match.Create(this)); } MarkAsModified(); }
private void SearchFacets(string searchKeyword) { Matches.Clear(); var matchingFacets = _facetTypes.SelectMany(x => x.Facets.Where(y => y.DisplayName.ToLower() .Contains(searchKeyword.ToLower()))) .Select(x => x.DisplayName) .Distinct(); foreach (var facet in matchingFacets) { Matches.Add(facet); } }
private void button1_Click(object sender, EventArgs e) { Matches.Clear(); Regex regex = new Regex(Search.Text); string[] content = Text.Text.Split(' '); foreach (string word in content) { if (regex.IsMatch(word)) { Matches.Text += word + ", "; } } }
private void ReloadTournaments(List <Tournament> tournaments) { Matches.Clear(); foreach (var tournament in tournaments) { Matches.Add(new MatchItemViewModel { //Dates = tournament.Dates, //Groups = tournament.Groups, //Logo = tournament.Logo, //Name = tournament.Name, //TournamentId = tournament.TournamentId, }); } }
public List <MatchResult> FindAllMatches(List <Person> personList = null) { Matches.Clear(); if (personList == null && Persons == null) { return(new List <MatchResult>()); } else if (personList == null && Persons != null) { personList = Persons; } for (int i = 0; i < personList.Count(); i++) { for (int j = i + 1; j < personList.Count(); j++) { int equalsFound = 0; int inequalsFound = 0; foreach (BasePattern pattern in MatchingPatterns) { BasePattern.MATCH_RESULT result = pattern.Compare(personList[i], personList[j]); if (result == BasePattern.MATCH_RESULT.NOT_EQUAL) { inequalsFound++; break; } else if (result == BasePattern.MATCH_RESULT.EQUAL) { equalsFound++; } } if (inequalsFound == 0 && equalsFound > 0) { MatchResult newMatch = new MatchResult(personList[i], personList[j]); Logger.Info($"New Match! -> {newMatch.ToString()}"); Matches.Add(newMatch); OnMatchFound?.Invoke(newMatch); } } } return(Matches); }
private void ReloadMatches(List <Match> matches) { Matches.Clear(); foreach (var match in matches) { Matches.Add(new MatchItemViewModel { DateId = match.DateId, DateTime = match.DateTime, Local = match.Local, LocalGoals = match.LocalGoals, LocalId = match.LocalId, MatchId = match.MatchId, StatusId = match.StatusId, TournamentGroupId = match.TournamentGroupId, Visitor = match.Visitor, VisitorGoals = match.VisitorGoals, VisitorId = match.VisitorId, WasPredicted = match.WasPredicted }); } }
/// <summary> /// Resets the Bracket. /// Affects Matches, Rankings, and bracket status. /// </summary> /// <remarks> /// This is overriden in Group Stages and Swiss, for added functionality. /// </remarks> protected virtual void ResetBracketData() { if (null == Matches) { Matches = new Dictionary <int, Match>(); } if (null == LowerMatches) { LowerMatches = new Dictionary <int, Match>(); } if (null == Rankings) { Rankings = new List <IPlayerScore>(); } IsFinished = false; Matches.Clear(); LowerMatches.Clear(); grandFinal = null; NumberOfRounds = NumberOfLowerRounds = 0; NumberOfMatches = 0; Rankings.Clear(); }
public async void LoadMatches() { Matches.Clear(); matchesList.Clear(); string json; HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", Authentication.token.Token); json = await client.GetStringAsync(BASE_URL + "api/matches"); ObservableCollection <Match> matches = JsonConvert.DeserializeObject <ObservableCollection <Match> >(json); var tlvm = TournamentListVM.getInstance(); await tlvm.LoadTournaments(); foreach (var m in matches) { matchesList.Add(new MatchVM(m)); } Matches = matchesList.OrderByDescending(m => m.Tournament.Timestamp).ToList(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Matches))); }
public void Clear() { DocOriginal = null; _docCompare = null; Matches.Clear(); }
private void Search() { Matches.Clear(); IEnumerable <TodoViewModel> results = AllEntries; string expression = Text.ToLower(); foreach (var match in StatusPattern.Matches(expression).OfType <Match>().OrderByDescending(x => x.Index)) { string statusName = match.Groups[1].Value; bool status = new[] { "done", "close", "closed" }.Contains(statusName); results = results.Where(r => r.Model.Done == status); expression = expression.Remove(match.Index, match.Length); } foreach (var match in TagPattern.Matches(expression).OfType <Match>().OrderByDescending(x => x.Index)) { string tagName = match.Groups[1].Value; if (string.IsNullOrWhiteSpace(tagName)) { tagName = match.Groups[2].Value; } if (string.IsNullOrWhiteSpace(tagName)) { continue; } results = results.Where(r => r.Tags.Any(t => t.Model.Name.Equals(tagName, StringComparison.OrdinalIgnoreCase))); expression = expression.Remove(match.Index, match.Length); } foreach (var match in DetailsPattern.Matches(expression).OfType <Match>().OrderByDescending(x => x.Index)) { string searchText = match.Groups[1].Value; if (string.IsNullOrWhiteSpace(searchText)) { searchText = match.Groups[2].Value; } if (string.IsNullOrWhiteSpace(searchText)) { continue; } results = results.Where(r => (r.Model.Details ?? string.Empty).ToLower().Contains(searchText)); expression = expression.Remove(match.Index, match.Length); } expression = expression.Trim(); if (!string.IsNullOrWhiteSpace(expression)) { results = results.Where(t => t.Model.Summary.ToLower().Contains(expression)); } foreach (var entry in results) { Matches.Add(entry); } }
public void Refresh(bool state) { Matches.Clear(); FillMatches(); }
public void Update() { { if (_offsetChanged) { Dispatcher.Invoke(() => { Matches.Clear(); }); _offsetChanged = false; } currentTime = DateTime.Now; Dispatcher.Invoke(() => { Matches = Repository.FindMatches(Matches, "", SelectedLanguage, MatchFilter, Comparison); }); matchescsv = ""; if (Matches != null) { foreach (var matchVw in Matches) { matchescsv += matchVw.LineObject.MatchId + ";"; matchescsv += "-" + matchVw.LineObject.MatchId + ";"; } if (ChangeTracker.LiveSelectedMode != 3) { UpdateHeaders(Matches); } else { foreach (var matchVw in Matches) { matchVw.IsHeader = false; } } if (Matches != null && StationRepository.EnableLiveStreaming && StreamData != null) { foreach (var matchVw in Matches) { if (StreamData.ContainsKey(matchVw.LineObject.BtrMatchId)) { matchVw.HaveStream = true; matchVw.StreamStarted = DateTime.Now > StreamData[matchVw.LineObject.BtrMatchId].StartDate && (matchVw.LiveBetStatus == eMatchStatus.Started || matchVw.LiveBetStatus == eMatchStatus.Stopped); matchVw.StreamID = StreamData[matchVw.LineObject.BtrMatchId].StreamID; } else { matchVw.HaveStream = false; matchVw.StreamStarted = false; matchVw.StreamID = 0; } } } } FillSportsBar(); } }
public void ResetServer() { UserConnections.Clear(); Matches.Clear(); }
public void ResetForTesting() { Members.Clear(); Matches.Clear(); Competitions.Clear(); }