Click or drag to resize
OrderedDictionaryTKey, TValueReplace Method
Changes the value associated with a given key. If the dictionary does not contain a key equal to the passed key, then an ArgumentException is thrown.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public void Replace(
	TKey key,
	TValue value
)

Parameters

key
Type: TKey
The new key.
value
Type: TValue
The new value to associated with that key.
Exceptions
ExceptionCondition
KeyNotFoundExceptionkey is not present in the dictionary
Remarks

Unlike adding or removing an element, changing the value associated with a key can be performed while an enumeration (foreach) on the the dictionary is in progress.

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

Replace takes time O(log N), where N is the number of entries in the dictionary.

See Also