IListContract<C>.SetItem(Int32, C) 方法

定义

替换指定索引处的元素。

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)

参数

index
Int32

要在其中设置元素的从零开始的索引。

value
C

要设置在指定索引处的元素。

例外

index 小于零。

-或-

index 等于或大于返回值 GetCount()

注解

该方法 SetItem 替换指定索引处的元素。 若要向 IListContract<C>添加元素,请使用 Insert 该方法。

若要确定一个 IListContract<C> 是否为只读,请调用该方法 GetIsReadOnly

适用于