ThreadSafeDictionaryTKey, TValueTryAdd Method

Tries to add the specified key and value to the ThreadSafeDictionaryTKey, TValue.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
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 for reference types.

Return Value

Boolean
if key and value was added to the ThreadSafeDictionaryTKey, TValue successfully; if the key already exists.

Exceptions

See Also