NameObjectCollectionBase.Count NameObjectCollectionBase.Count NameObjectCollectionBase.Count NameObjectCollectionBase.Count Property

定義

取得 NameObjectCollectionBase 執行個體中包含的索引鍵/值組數目。Gets the number of key/value pairs contained in the NameObjectCollectionBase instance.

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

屬性值

NameObjectCollectionBase 執行個體中包含的索引鍵/值組數目。The number of key/value pairs contained in the NameObjectCollectionBase instance.

實作

備註

容量是項目數目,NameObjectCollectionBase可以儲存。The capacity is the number of elements that the NameObjectCollectionBase can store. Count 是實際的項目數NameObjectCollectionBaseCount is the number of elements that are actually in the NameObjectCollectionBase.

容量永遠是大於或等於CountThe capacity is always greater than or equal to Count. 如果Count超過容量加入元素時,會自動將舊的項目複製並加入新項目之前,重新配置內部陣列增加容量。If Count exceeds the capacity while adding elements, the capacity is automatically increased by 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.

適用於