Bewerken

Delen via


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

Definition

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

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

Parameters

index
Int32

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

item
T

The item to set at the specified index.

Exceptions

index is less than zero.

-or-

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

The IListContract<T> collection is read-only.

Remarks

The SetItem method sets the item at the specified index. To add an item to the IListContract<T> collection, use the Insert method.

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

Applies to