执行二进制搜索列表的泛型对象。如果未在列表中找到的对象,此方法应在此处插入通用对象列表中查找的从零开始的索引位置。
命名空间: Microsoft.SharePoint.Utilities
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Shared Function BinarySearchWithFallback(Of T) ( _
lst As IList(Of T), _
t As T, _
comparer As IComparer, _
<OutAttribute> ByRef found As Boolean _
) As Integer
用法
Dim lst As IList(Of T)
Dim t As T
Dim comparer As IComparer
Dim found As Boolean
Dim returnValue As Integer
returnValue = SPUtility.BinarySearchWithFallback(lst, _
t, comparer, found)
public static int BinarySearchWithFallback<T>(
IList<T> lst,
T t,
IComparer comparer,
out bool found
)
类型参数
- T
为其位置是要找的通用对象的类型。
参数
lst
类型:System.Collections.Generic.IList<T>要搜索指定的泛型类型的列表。
t
类型:T要找的对象。
comparer
类型:System.Collections.IComparer实现由类型比较两个对象的方法。
found
类型:System.Booleantrue指示的通用对象 ; 如果未找到否则为false。
返回值
类型:System.Int32
一个 32 位整数,表示列表中的对象的索引位置或者,如果未找到对象,该对象应插入列表的索引位置。