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))); } }
/// <summary>Count how many predicates are false</summary> public int CountFalse(T item) { return(Predicates.Count(predicate => !predicate(item))); }
/// <summary>Count how many predicates are true</summary> public int CountTrue(T item) { return(Predicates.Count(predicate => predicate(item))); }