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!

ArrayList.TrimToSize

Sets the capacity of the ArrayList to the actual number of elements in it.

[Visual Basic]
Overridable Public Sub TrimToSize()
[C#]
public virtual void TrimToSize();
[C++]
public: virtual void TrimToSize();
[JScript]
public function TrimToSize();

Return Value

None.

Exceptions

Exception Type Condition
NotSupportedException The ArrayList is read-only.

-or-

The ArrayList has a fixed size.

Remarks

This method can be overridden by a derived class.

This method can be used to minimize a list's memory overhead if no new elements would be added to the list.

To completely clear all elements in a list, call the Clear method before calling TrimToSize.

See Also

ArrayList Class | ArrayList Members | System.Collections Namespace | Clear | TrimToSize | Capacity | Count