public int Add(
TKey key,
TValue value
)
Public Function Add (
key As TKey,
value As TValue
) As Integer
public:
int Add(
TKey key,
TValue value
)
member Add :
key : 'TKey *
value : 'TValue -> int
A key cannot be , but a value can be, if the type of values in the sorted list, TValue, is a reference or NullableT type.
You can also use the indexer to add new elements by setting the value of a key that does not exist in the CircularSortedListTKey, TValue. for example:
myCollection["myNonexistentKey"] = myValue;
If Count already equals Capacity, the capacity of the CircularSortedListTKey, TValue is increased by automatically reallocating the array in internal CircularListT, and the existing elements are copied to the new array before the new element is added.
This method is an O(n) operation for unsorted data, where n is Count. It is an O(1) operation if the new element is added at the end or the head of the list. If insertion causes a resize, the operation is O(n).
ArgumentNullException | key is . |
ArgumentException | An element with the same key already exists in the CircularSortedListTKey, TValue. |