PropertyCollection.IDictionary.Contains(Object) Método

Definição

Determina se o IDictionary objeto contém um elemento com a chave 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

A chave a ser localizada no IDictionary objeto.

Retornos

true se ele IDictionary contiver um elemento com a chave; caso contrário, false.

Implementações

Exceções

value é null.

Exemplos

O exemplo a seguir demonstra como implementar o Contains método. Este exemplo faz parte de um exemplo maior fornecido para a IDictionary classe.

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

Aplica-se a