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

Definition

Inserts an element in the IListContract<C> at the specified index.

public:
 void Insert(int index, C item);
public void Insert (int index, C item);
abstract member Insert : int * 'C -> unit
Public Sub Insert (index As Integer, item As C)

Parameters

index
Int32

The zero-based index at which to insert item.

item
C

The IContract to insert in the IListContract<C>.

Exceptions

index is less than zero.

-or-

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

Remarks

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

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

Applies to