Documents for PDF, .NET Edition Documentation
BinarySearch(Int32,Int32,T,StructComparison<T>) Method

GrapeCity.Documents.Common Assembly > GrapeCity.Documents.Common Namespace > ReadOnlyStructList<T> Class > BinarySearch Method : BinarySearch(Int32,Int32,T,StructComparison<T>) Method
The zero-based starting index of the range to search.
The length of the range to search.
The object to locate.
The GrapeCity.Documents.Common.StructComparison`1 to use when comparing elements.
Searches a range of elements in the sorted ReadOnlyStructList<T> for an element using the specified GrapeCity.Documents.Common.StructComparison`1 and returns the zero-based index of the element.
Syntax
'Declaration
 
Public Overloads Function BinarySearch( _
   ByVal index As System.Integer, _
   ByVal count As System.Integer, _
   ByRef item As T, _
   ByVal comparison As GrapeCity.Documents.Common.StructComparison(Of T) _
) As System.Integer
public System.int BinarySearch( 
   System.int index,
   System.int count,
   ref T item,
   GrapeCity.Documents.Common.StructComparison<T> comparison
)

Parameters

index
The zero-based starting index of the range to search.
count
The length of the range to search.
item
The object to locate.
comparison
The GrapeCity.Documents.Common.StructComparison`1 to use when comparing elements.

Return Value

The zero-based index of item in the sorted ReadOnlyStructList<T>, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of Count.
See Also

Reference

ReadOnlyStructList<T> Class
ReadOnlyStructList<T> Members
Overload List