Edit

Share via


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

Definition

Replaces the element at the specified index.

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

Parameters

index
Int32

The zero-based index at which to set the element.

value
C

The element to set at the specified index.

Exceptions

index is less than zero.

-or-

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

Remarks

The SetItem method replaces the element at the specified index. To add an element to the IListContract<C>, use the Insert method.

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

Applies to