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.Add

Adds an element with the specified key and value into the SortedList.

[Visual Basic]
Overridable Public Sub Add( _
   ByVal key As Object, _
   ByVal value As Object _
)
[C#]
public virtual void Add(
   object key,
   object value
);
[C++]
public: virtual void Add(
   Object* key,
   Object* value
);
[JScript]
public function Add(
   key : Object,
   value : Object
);

Parameters

key
The key of the element to add.
value
The value of the element to add.

Return Value

None.

Exceptions

Exception Type Condition
ArgumentNullException key is a null reference (in Visual Basic Nothing).
ArgumentException An element with the specified key already exists in the SortedList.

-or-

The SortedList is set to use the IComparable interface, and key does not implement the IComparable interface.

Remarks

This method can be overridden by a derived class.

When adding elements to the list and the number of elements exceeds the capacity, the capacity is doubled.The insertion point is determined based on the comparer selected, either explicitly or by default, when the SortedList was instantiated.

a null reference (Nothing) is not allowed as a key, but is allowed as a value.

See Also

SortedList Class | SortedList Members | System.Collections Namespace | Item | IComparer | IComparable | Capacity