ConcurrentDictionary<TKey,TValue>.IDictionary.Contains(Object) Method

Definition

获取一个值,它指示 IDictionary<TKey,TValue> 包含具有指定键的元素。Gets a value that indicates the IDictionary<TKey,TValue> contains an element with the specified key.

 virtual bool System.Collections.IDictionary.Contains(System::Object ^ key) = System::Collections::IDictionary::Contains;
bool IDictionary.Contains (object key);
abstract member System.Collections.IDictionary.Contains : obj -> bool
override this.System.Collections.IDictionary.Contains : obj -> bool
Function Contains (key As Object) As Boolean Implements IDictionary.Contains

Parameters

key
Object

要在 IDictionary<TKey,TValue> 中定位的键。The key to locate in the IDictionary<TKey,TValue>.

Returns

Boolean

如果 IDictionary<TKey,TValue> 包含具有指定键的元素,则为 true;否则为 falsetrue if the IDictionary<TKey,TValue> contains an element with the specified key; otherwise, false.

Implements

Exceptions

keynullkey is null.

Applies to

See also