Udostępnij za pośrednictwem


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

Definicja

Zamienia element w określonym indeksie.

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)

Parametry

index
Int32

Indeks oparty na zera, w którym należy ustawić element.

value
C

Element do ustawienia w określonym indeksie.

Wyjątki

Parametr index ma wartość niższą niż zero.

-lub-

indexjest równa lub większa niż zwracana wartość .GetCount()

Element IListContract<C> jest tylko do odczytu.

Uwagi

Metoda SetItem zastępuje element w określonym indeksie. Aby dodać element do IListContract<C>metody , użyj Insert metody .

Aby określić, czy element IListContract<C> jest tylko do odczytu, wywołaj metodę GetIsReadOnly .

Dotyczy