Click or drag to resize

OrderedDictionaryTKey, TValueAdd Method

Adds an entry with the specified key and value into the OrderedDictionary<TKey,TValue> collection with the lowest available index.

Namespace:  Ifs.Fnd.Core
Assembly:  Ifs.Fnd.Core (in Ifs.Fnd.Core.dll) Version: 4.52.10.0 (10.2.2.9999)
Syntax
C#
public int Add(
	TKey key,
	TValue value
)

Parameters

key
Type: TKey
The key of the entry to add.
value
Type: TValue
The value of the entry to add. This value can be .

Return Value

Type: Int32
The index of the newly added entry

Implements

IOrderedDictionaryTKey, TValueAdd(TKey, TValue)
Exceptions
ExceptionCondition
ArgumentNullExceptionkey is
ArgumentExceptionAn element with the same key already exists in the OrderedDictionary<TKey,TValue>
Remarks
A key cannot be , but a value can be.

You can also use the Item property to add new elements by setting the value of a key that does not exist in the OrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the OrderedDictionary<TKey,TValue>, setting the Item property overwrites the old value. In contrast, the [M:Add] method does not modify existing elements.

See Also