語言

ReadOnlyDictionary<TKey,TValue>.IDictionary.Contains(Object) 方法

定義

判斷字典中是否包含具有指定鍵值的元素。

 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

參數

key
Object

關鍵是要在字典中找到。

傳回

true如果字典包含具有指定鍵的元素;否則,。 false

實作

例外狀況

key 是 null。

備註

此成員為明確介面成員實作。 它只能在實 ReadOnlyDictionary<TKey,TValue> 例投射到 IDictionary 介面時使用。

適用於