PropertyCollection.IDictionary.Contains(Object) Método

Definición

Determina si el objeto IDictionary contiene un elemento con la clave especificada.

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

Parámetros

value
Object

Clave que se buscará en el objeto IDictionary.

Devoluciones

Es true si IDictionary contiene un elemento con la clave; en caso contrario, es false.

Implementaciones

Excepciones

key es null.

Ejemplos

En el ejemplo siguiente se muestra cómo implementar el Contains método . Este ejemplo forma parte de un ejemplo más grande proporcionado para la IDictionary clase .

public:
    virtual bool Contains(Object^ key)
    {
        int index;
        return TryGetIndexOfKey(key, &index);
    }
public bool Contains(object key)
{
   Int32 index;
   return TryGetIndexOfKey(key, out index);
}
Public Function Contains(ByVal key As Object) As Boolean Implements IDictionary.Contains
    Dim index As Integer
    Return TryGetIndexOfKey(key, index)
End Function

Se aplica a