NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SortedList.Capacity

Gets or sets the capacity of the SortedList.

[Visual Basic]
Overridable Public Property Capacity As Integer
[C#]
public int Capacity {virtual get; virtual set;}
[C++]
public: __property virtual int get_Capacity();
public: __property virtual void set_Capacity(int);
[JScript]
public function get Capacity() : int;
public function set Capacity(int);

Property Value

The number of elements that the SortedList can contain.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException The value assigned is less than the current number of elements in the SortedList.

Remarks

When adding elements to the list and the number of elements exceeds the capacity, the capacity is doubled.

When Capacity is set, the internal arrays are reallocated to accommodate the new capacity.

TrimToSize can also be used to reduce the capacity of the SortedList.

See Also

SortedList Class | SortedList Members | System.Collections Namespace | TrimToSize