System.Collections.Specialized.ListDictionary.Contains Method

Determines whether the System.Collections.Specialized.ListDictionary contains a specific key.

Syntax

public bool Contains (object key)

Parameters

key
The key to locate in the System.Collections.Specialized.ListDictionary.

Returns

true if the System.Collections.Specialized.ListDictionary contains an entry with the specified key; otherwise, false.

Remarks

This method is an O(n) operation, where n is ListDictionary.Count.

Starting with the .NET Framework 2.0, this method uses the collection’s objects’ object.Equals(object) and IComparable.CompareTo(object) methods on key to determine whether item exists. In the earlier versions of the .NET Framework, this determination was made by using the object.Equals(object) and IComparable.CompareTo(object) methods of the item parameter on the objects in the collection.

Requirements

Namespace: System.Collections.Specialized
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0