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

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

Finds the first occurence of count consecutive items in the list for which a given predicate returns true.

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

Syntax


public static int FirstConsecutiveWhere<T>(
	IList<T> list,
	int count,
	Predicate<T> predicate
)
Public Shared Function FirstConsecutiveWhere(Of T) ( _
	list As IList(Of T), _
	count As Integer, _
	predicate As Predicate(Of T) _
) As Integer
public:
generic<typename T>
static int^ FirstConsecutiveWhere(
	IList<T>^ list, 
	int^ count, 
	Predicate<T>^ predicate
)

Type Parameters

T

Parameters

list
Type: IList<(Of <(<'T>)>)>
The list to examine.
count
Type: Int32
The number of consecutive items to look for. The count must be at least 1.
predicate
Type: Predicate<(Of <(<'T>)>)>
The predicate used to test each item.

Return Value

The index of the first item in the first run of count items where predicate returns true for all items in the run, or -1 if no such run exists.