コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: ProxyFilter.cs プロジェクト: dougan778/ProxyTools
 public ProxyFilterQuery(ProxyFilter filter, Guid sessionGuid, SortModes sortMode)
 {
     _proxyFilter = filter;
     _sessionGuid = sessionGuid;
     _sortMode    = sortMode;
 }