JsonNodeListInsert Method

Inserts an item into the list, checking for duplication.

Definition

Namespace: MichaelBrooks.UK.Json
Assembly: JsonDOM (in JsonDOM.dll) Version: 1.0.7
C#
public void Insert(
	int index,
	JsonNode item
)

Parameters

index  Int32
The zero-based location where the item is to reside. Existing list items at that location and higher-numbered index locations are moved to the next higher index location to make space for the insert.
item  JsonNode
The item to insert.

Remarks

Note that it is valid to insert an item at the index location equal to the current value of the Count property, as this is effectively the same as appending the item to the end of the list.

Online page.

Exceptions

ArgumentOutOfRangeExceptionindex is less than zero or greater than value of Count property.
JsonNodeListDuplicateItemExceptionThrown when item already exists in the list.
InvalidOperationExceptionThrown when item has the wrong parent.

See Also