public int BinarySearch(T[] array, int index, int length, T value, IComparer <T> comparer) { Debug.Assert(array != null, "Check the arguments in the caller!"); Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); try { if (comparer == null || comparer == Comparer <T> .Default) { return(BinarySearch(array, index, length, value)); } else { return(ArraySortHelper <T> .InternalBinarySearch(array, index, length, value, comparer)); } } catch (ThreadAbortException) { throw; } catch (Exception e) { throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); } }
public int BinarySearch(T[] array, int index, int length, T value, IComparer <T> comparer) { try { if (comparer == null || comparer == Comparer <T> .Default) { return(GenericArraySortHelper <T> .BinarySearch(array, index, length, value)); } return(ArraySortHelper <T> .InternalBinarySearch(array, index, length, value, comparer)); } catch (Exception ex) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), ex); } }
public int BinarySearch(T[] array, int index, int length, T value, IComparer <T> comparer) { try { if (comparer == null || comparer == Comparer <T> .Default) { return(BinarySearch(array, index, length, value)); } else { return(ArraySortHelper <T> .InternalBinarySearch(array, index, length, value, comparer)); } } catch (Exception e) { throw new InvalidOperationException("InvalidOperation_IComparerFailed"); } }
// Token: 0x06003A1C RID: 14876 RVA: 0x000DC234 File Offset: 0x000DA434 public int BinarySearch(T[] array, int index, int length, T value, IComparer <T> comparer) { int result; try { if (comparer == null) { comparer = Comparer <T> .Default; } result = ArraySortHelper <T> .InternalBinarySearch(array, index, length, value, comparer); } catch (Exception innerException) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), innerException); } return(result); }
public int BinarySearch(T[] array, int index, int length, T value, IComparer <T> comparer) { Contract.Assert(array != null, "Check the arguments in the caller!"); Contract.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); try { if (comparer == null || comparer == Comparer <T> .Default) { return(BinarySearch(array, index, length, value)); } else { return(ArraySortHelper <T> .InternalBinarySearch(array, index, length, value, comparer)); } } catch (Exception e) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } }