System.Collections.SortedList.Count Property

Gets the number of elements contained in a SortedList object.

Syntax

public virtual int Count { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Each element is a key/value pair that can be accessed as a DictionaryEntry object.

SortedList.Capacity is the number of elements that the SortedList object can store. SortedList.Count is the number of elements that are actually in the SortedList.

SortedList.Capacity is always greater than or equal to SortedList.Count. If SortedList.Count exceeds SortedList.Capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements.

Retrieving the value of this property is an O(1) operation.

Requirements

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