Click or drag to resize

OrderedDictionaryTKey, TValueTryAdd Method

Tries to add the specified key and value to the dictionary as an O(1) operation.

Namespace: GSF.Collections
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.256-beta+0e7e94d39a9b10efe7e26e3b8d5130afc0dd4d74
Syntax
public bool TryAdd(
	TKey key,
	TValue value
)
View Source

Parameters

key  TKey
The key of the element to add.
value  TValue
The value of the element to add. The value can be null for reference types.

Return Value

Boolean
true if the element was added to the OrderedDictionaryTKey, TValue; false if the OrderedDictionaryTKey, TValue already contained an element with the specified key.
Exceptions
ExceptionCondition
ArgumentNullExceptionkey is null.
See Also