Mono Class Library: System.Collections.Generic.Dictionary<TKey,TValue> Overview | Members

System.Collections.Generic.Dictionary<TKey,TValue>.ContainsValue Method

Determines whether the dictionary contains an element with a specific value.

public bool ContainsValue (TValue value)

Parameters

value
The value to locate in the dictionary.

Returns

true, if an element whose value is value is found in the dictionary; otherwise, false.

Remarks

This method determines equality using the default equality comparer for the value type TValue. If TValue implements IEquatable<TValue>, that type is used. Otherwise, object.Equals is used.

This method performs a linear search; therefore, the average execution time is proportional to Dictionary<TKey, TValue>.Count. That is, this method is an O(n) operation, where n is Dictionary<TKey, TValue>.Count.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0