Method Insert
Insert(Int32, String, FieldValue)
Inserts an entry with the specified key and the specified value at
the specified index.
Declaration
public void Insert(int index, string key, FieldValue value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Zero-based index at which the entry should be inserted. |
String | key | Key to add. |
FieldValue | value | Value to add. If null ,
Null will be added instead. |
Remarks
If
index
is equal to
Count, the key
and
value
are added to the end of the collection.
Note that for this method the order of the new entry within the
dictionary is determined only by index
.
Existing indexes following the index
may be
shifted to make room for the new entry.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If key
is null . |
ArgumentOutOfRangeException | If
index is less than 0 or greater than
Count |
ArgumentException | The value with the specified key already exists in the dictionary. |