public virtual bool MatchesFilter(ProxyFilter pf) { if (pf == null) { return(true); } if (pf.Site != null) { var score = ProxySiteScores.FirstOrDefault(f => string.Equals(pf.Site, f.Site, StringComparison.OrdinalIgnoreCase)); if (score != null) { if (pf.NotBanned && score.Banned) { return(false); } if (pf.MinSiteScore != null && pf.MinSiteScore.Value > score.Score) { return(false); } } if (pf.Score != null && pf.Score > this.Score) { return(false); } else { // If there are no proxies for the site, then we will consider it to match until we are told differently. return(true); } } return(true); }
public ProxyFilterQuery(ProxyFilter filter, Guid sessionGuid, SortModes sortMode) { _proxyFilter = filter; _sessionGuid = sessionGuid; _sortMode = sortMode; }