|
OrderedDictionaryTKey, TValueTryAdd Method
|
Tries to add the specified key and value to the dictionary as an O(1) operation.
Namespace: GSF.CollectionsAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax public bool TryAdd(
TKey key,
TValue value
)
Public Function TryAdd (
key As TKey,
value As TValue
) As Boolean
public:
bool TryAdd(
TKey key,
TValue value
)
member TryAdd :
key : 'TKey *
value : 'TValue -> bool
function TryAdd(key, value);
View SourceParameters
- 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
Booleantrue if the element was added to the
OrderedDictionaryTKey, TValue; false if the
OrderedDictionaryTKey, TValue already contained an element with the specified key.
Exceptions See Also