public bool Contains(int val) { bool found = this.dispersiveKeySortedArray.Contains(val); if (!found) { found = CollectionHelper.ContainsSpecification <KeyScope>(this.dispersiveKeyScopeList, delegate(KeyScope scope) { return(scope.Contains(val)); }); } return(found); }
/// <summary> /// ContainsSpecification 集合中是否包含满足predicate条件的元素。 /// </summary> public static bool ContainsSpecification <TObject>(IEnumerable <TObject> source, Predicate <TObject> predicate) { TObject specification; return(CollectionHelper.ContainsSpecification <TObject>(source, predicate, out specification)); }