예제 #1
0
        protected bool Filter(Tweet tweet)
        {
            if (Predicates.Count() == 0)
            {
                return(true);
            }

            if (IsOrSearch.Value)
            {
                return(Predicates.Any(predicate => predicate(tweet)));
            }
            else
            {
                return(Predicates.All(predicate => predicate(tweet)));
            }
        }
예제 #2
0
 /// <summary>Count how many predicates are false</summary>
 public int CountFalse(T item)
 {
     return(Predicates.Count(predicate => !predicate(item)));
 }
예제 #3
0
 /// <summary>Count how many predicates are true</summary>
 public int CountTrue(T item)
 {
     return(Predicates.Count(predicate => predicate(item)));
 }