
public virtual int
BinarySearch(int index, int count, object value, IComparer comparer);
Searches a range of elements in the sorted System.Collections.ArrayList for an element using the specified comparer and returns the zero-based index of the element.
Полное описание ... Parameters:
index:
The zero-based starting index of the range to search.
count:
The length of the range to search.
value:
The System.Object to locate. The value can be null.
comparer:
The System.Collections.IComparer implementation to use when comparing elements.-or-
null to use the default comparer that is the System.IComparable implementation
of each element.
Exceptions:
The zero-based index of value in the sorted System.Collections.ArrayList,
if value is found; otherwise, a negative number, which is the bitwise complement
of the index of the next element that is larger than value or, if there is
no larger element, the bitwise complement of System.Collections.ArrayList.Count.
Exceptions:
System.ArgumentException:
index and count do not denote a valid range in the System.Collections.ArrayList.-or-
comparer is null and neither value nor the elements of System.Collections.ArrayList
implement the System.IComparable interface.
System.InvalidOperationException:
comparer is null and value is not of the same type as the elements of the
System.Collections.ArrayList.
System.ArgumentOutOfRangeException:
index is less than zero.-or- count is less than zero.