Wintellect.PowerCollections Namespace
Algorithms Class
Algorithms Methods
GhostDoc Pro Sample Help File

Algorithms..::..TryFindFirstWhere<(Of <(<'T>)>)> Method

Finds the first item in a collection that satisfies the condition defined by predicate.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public static bool TryFindFirstWhere<T>(
	IEnumerable<T> collection,
	Predicate<T> predicate,
	out T foundItem
)
Public Shared Function TryFindFirstWhere(Of T) ( _
	collection As IEnumerable(Of T), _
	predicate As Predicate(Of T), _
	<OutAttribute> ByRef foundItem As T _
) As Boolean
public:
generic<typename T>
static bool^ TryFindFirstWhere(
	IEnumerable<T>^ collection, 
	Predicate<T>^ predicate, 
	[OutAttribute] T% foundItem
)

Type Parameters

T

Parameters

collection
Type: IEnumerable<(Of <(<'T>)>)>
The collection to search.
predicate
Type: Predicate<(Of <(<'T>)>)>
A delegate that defined the condition to check for.
foundItem
Type: T%
Outputs the first item in the collection that matches the condition, if the method returns true.

Return Value

True if an item satisfying the condition was found. False if no such item exists in the collection.