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
)

Parameters

index
Type: System.Int32

The zero-based index at which to insert item.

item
Type: T

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

Exception Condition
IndexOutOfRangeException

index is less than zero.

-or-

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

NotSupportedException

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
Show:
© 2016 Microsoft