ReadOnlyCollection<T>.IList.Contains(Object) 方法
定义
virtual bool System.Collections.IList.Contains(System::Object ^ value) = System::Collections::IList::Contains;
bool IList.Contains (object value);
abstract member System.Collections.IList.Contains : obj -> bool
override this.System.Collections.IList.Contains : obj -> bool
Function Contains (value As Object) As Boolean Implements IList.Contains
参数
返回
如果在 IList 中找到了 Object,则为 true;否则为 false。true if the Object is found in the IList; otherwise, false.
实现
例外
value 所属的类型不是泛型类型参数 T 的指定类型。value is not of the type specified for the generic type parameter T.
注解
此方法使用默认比较器确定相等性 EqualityComparer<T>.Default 。This method determines equality using the default comparer EqualityComparer<T>.Default.
此方法执行线性搜索;因此,此方法是 O (n) 操作,其中 n 是 Count 。This method performs a linear search; therefore, this method is an O(n) operation, where n is Count.
此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 ReadOnlyCollection<T> 实例被强制转换为 IList 接口时使用。It can be used only when the ReadOnlyCollection<T> instance is cast to an IList interface.