Insert Method

IListContract<T>.Insert Method (Int32, T)

.NET Framework (current version)

Inserts an item at the specified index in an IListContract<T> collection.

Namespace:   System.AddIn.Contract
Assembly:  System.AddIn.Contract (in System.AddIn.Contract.dll)

void Insert(
	int index,
	T item


Type: System.Int32

The zero-based index at which to insert item.

Type: T

The IContract object to insert in the IListContract<T> collection.

Exception Condition

index is less than zero.


index is equal to or greater than the return value of GetCount.


The IListContract<T> collection is read-only.

After you call the Insert method, the items that follow the insertion point move to accommodate the new item. The indexes of the items that are moved are also updated. To replace an item at a specified index, use the SetItem method.

To determine whether an IListContract<T> collection is read-only, call the GetIsReadOnly method.

.NET Framework
Available since 3.5
Return to top
© 2016 Microsoft