IOrderedDictionaryTKey, TValueAdd Method |
Namespace: Ifs.Fnd.Core
int Add( TKey key, TValue value )
Exception | Condition |
---|---|
ArgumentException | An element with the same key already exists in the IOrderedDictionary<TKey,TValue> |
NotSupportedException | The IOrderedDictionary<TKey,TValue> is read-only. -or- The IOrderedDictionary<TKey,TValue> has a fized size. |
You can also use the Item(TKey) property to add new elements by setting the value of a key that does not exist in the IOrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the IOrderedDictionary<TKey,TValue>, setting the [P:Item(TKey)] property overwrites the old value. In contrast, the [M:Add] method does not modify existing elements.