Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

OrderedDictionary<(Of <(<'TKey, TValue>)>)>..::..Add Method

Adds a new key and value to the dictionary. If the dictionary already contains a key equal to the passed key, then an ArgumentException is thrown

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public void Add(
	TKey key,
	TValue value
)
Public Sub Add ( _
	key As TKey, _
	value As TValue _
)
public:
void Add(
	TKey key, 
	TValue value
)

Parameters

key
Type: TKey
The new key. "null" is a valid key value.
value
Type: TValue
The new value to associated with that key.

Exceptions


ExceptionCondition
ArgumentExceptionkey is already present in the dictionary

Remarks


Equality between keys is determined by the comparison instance or delegate used to create the dictionary.

Adding an key and value takes time O(log N), where N is the number of keys in the dictionary.