JsonNodeListInsertRange Method

Inserts the elements of a collection of JsonNode at the specified index, checking for duplication.

Definition

Namespace: MichaelBrooks.UK.Json
Assembly: JsonDOM (in JsonDOM.dll) Version: 1.0.7
C#
public void InsertRange(
	int index,
	IEnumerable<JsonNode> collection
)

Parameters

index  Int32
The zero-based location where the collection is to be inserted. Existing list items at that location and higher-numbered index locations are moved to even higher index locations to make space for the insert.
collection  IEnumerableJsonNode

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 an item from collection already exists in the list.
InvalidOperationExceptionThrown when an item in collection has the wrong parent.

See Also