Count Property
Collapse the table of content
Expand the table of content

NameObjectCollectionBase.Count Property

 

Gets the number of key/value pairs contained in the NameObjectCollectionBase instance.

Namespace:   System.Collections.Specialized
Assembly:  System (in System.dll)

abstract Count : int with get
override Count : int with get

Property Value

Type: System.Int32

The number of key/value pairs contained in the NameObjectCollectionBase instance.

The capacity is the number of elements that the NameObjectCollectionBase can store. Count is the number of elements that are actually in the NameObjectCollectionBase.

The capacity is always greater than or equal to 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.

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

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft