SortedList<TKey,TValue>.Count 屬性

定義

取得 SortedList<TKey,TValue> 中所包含的索引鍵/值組數目。Gets the number of key/value pairs contained in the SortedList<TKey,TValue>.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

屬性值

Int32

SortedList<TKey,TValue> 中所包含的索引鍵/值組數目。The number of key/value pairs contained in the SortedList<TKey,TValue>.

實作

備註

Capacity 這是可以儲存的元素數目 SortedList<TKey,TValue>Capacity is the number of elements that the SortedList<TKey,TValue> can store. Count 這是實際在中的元素數目 SortedList<TKey,TValue>Count is the number of elements that are actually in the SortedList<TKey,TValue>.

Capacity 一律大於或等於 CountCapacity is always greater than or equal to Count. 如果 CountCapacity 新增專案時超過,則會在複製舊專案並加入新元素之前,自動重新配置內部陣列來增加容量。If Count exceeds Capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements.

擷取這個屬性的值是一種 O(1) 運算。Retrieving the value of this property is an O(1) operation.

適用於

另請參閱