[]
        
(Showing Draft Content)

GrapeCity.Win.Spread.InputMan.CellType.CollectionBase-1.FindLastIndex

FindLastIndex Method

FindLastIndex<TTarget>()

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire List<T>.

Declaration
public int FindLastIndex<TTarget>() where TTarget : T
Public Function FindLastIndex(Of TTarget As T)() As Integer
Returns
Type Description
int

The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, false.

Type Parameters
Name Description
TTarget

FindLastIndex<TTarget>(Predicate<TTarget>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire List<T>.

Declaration
public int FindLastIndex<TTarget>(Predicate<TTarget> match) where TTarget : T
Public Function FindLastIndex(Of TTarget As T)(match As Predicate(Of TTarget)) As Integer
Parameters
Type Name Description
Predicate<TTarget> match

The Predicate<T> delegate that defines the conditions of the element to search for.

Returns
Type Description
int

The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, false.

Type Parameters
Name Description
TTarget
Exceptions
Type Condition
ArgumentNullException

match is null.

FindLastIndex<TTarget>(int, Predicate<TTarget>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the List<T> that extends from the first element to the specified index.

Declaration
public int FindLastIndex<TTarget>(int startIndex, Predicate<TTarget> match) where TTarget : T
Public Function FindLastIndex(Of TTarget As T)(startIndex As Integer, match As Predicate(Of TTarget)) As Integer
Parameters
Type Name Description
int startIndex

The zero-based starting index of the backward search.

Predicate<TTarget> match

The Predicate<T> delegate that defines the conditions of the element to search for.

Returns
Type Description
int

The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, false.

Type Parameters
Name Description
TTarget
Exceptions
Type Condition
ArgumentOutOfRangeException

startIndex is outside the range of valid indexes for the List<T>.

ArgumentNullException

match is null.

FindLastIndex<TTarget>(int, int, Predicate<TTarget>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the List<T> that contains the specified number of elements and ends at the specified index.

Declaration
public int FindLastIndex<TTarget>(int startIndex, int count, Predicate<TTarget> match) where TTarget : T
Public Function FindLastIndex(Of TTarget As T)(startIndex As Integer, count As Integer, match As Predicate(Of TTarget)) As Integer
Parameters
Type Name Description
int startIndex

The zero-based starting index of the backward search.

int count

The number of elements in the section to search.

Predicate<TTarget> match

The Predicate<T> delegate that defines the conditions of the element to search for.

Returns
Type Description
int

The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, false.

Type Parameters
Name Description
TTarget
Exceptions
Type Condition
ArgumentOutOfRangeException

count is less than 0.

ArgumentNullException

match is null.