パラメータ
- key
- The key of the entry to add.
- value
- The value of the entry to add. This value can be .
戻り値の型
The index of the newly added entry.
| 例外 | 解説 |
|---|---|
| System.ArgumentNullException | key is |
| System.ArgumentException | An element with the same key already exists in the OrderedDictionary<TKey,TValue>. |
You can also use the Item OrderedDictionary<TKey,TValue> 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 of OrderedDictionary<TKey,TValue> property overwrites the old value. In contrast, the OrderedDictionary<TKey,TValue>.Add method does not modify existing elements.