 | CondensedCollectionExtensionsAllTSource Method |
[This is preliminary documentation and is subject to change.]
Determines whether all elements of the collection satisfy a condition. Optimized for a CondensedCollection.
Namespace:
Condensed.Linq
Assembly:
Condensed (in Condensed.dll) Version: 0.1.0.0 (0.1.0.0)
Syntaxpublic static bool All<TSource>(
this CondensedCollection<TSource> source,
Func<TSource, bool> predicate
)
<ExtensionAttribute>
Public Shared Function All(Of TSource) (
source As CondensedCollection(Of TSource),
predicate As Func(Of TSource, Boolean)
) As Boolean
public:
[ExtensionAttribute]
generic<typename TSource>
static bool All(
CondensedCollection<TSource>^ source,
Func<TSource, bool>^ predicate
)
[<ExtensionAttribute>]
static member All :
source : CondensedCollection<'TSource> *
predicate : Func<'TSource, bool> -> bool
Parameters
- source
- Type: CondensedCondensedCollectionTSource
The collection to evaluate. - predicate
- Type: SystemFuncTSource, Boolean
A function to test each element for a condition.
Type Parameters
- TSource
- The type of the elements of source.
Return Value
Type:
Booleantrue if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise,
false.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
CondensedCollectionTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
This implementation of All() is specialized for a CondensedCollection and tries to
take advantage of the CondensedCollection's knowledge of unique values in order to improve performance.
If you would rather use the normal LINQ extension method then cast the CondensedCollection to an
IListT
to use the
AllTSource(IEnumerableTSource, FuncTSource, Boolean) implementation.
See Also