OrderedDictionaryTKey, TValueTryAdd Method

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

Definition

Namespace: Gemstone.Collections
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public bool TryAdd(
	TKey key,
	TValue value
)

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

ArgumentNullExceptionkey is null.

See Also