SynchronizedCollection<T>.IList.Insert(Int32, Object) 方法

定義

在指定的索引位置,插入物件至集合之中。

 virtual void System.Collections.IList.Insert(int index, System::Object ^ value) = System::Collections::IList::Insert;
void IList.Insert (int index, object value);
abstract member System.Collections.IList.Insert : int * obj -> unit
override this.System.Collections.IList.Insert : int * obj -> unit
Sub Insert (index As Integer, value As Object) Implements IList.Insert

參數

index
Int32

要在該處插入 value 之以零起始的索引。

value
Object

要插入集合的物件。

實作

例外狀況

指定的 index 小於零或大於集合中的項目數。

設定的 valuenull,或者不是適用於該集合的正確泛型型別 T

備註

如果 index 等於集合中的項目數目,則項目會附加至清單。 如果 index 小於集合中的項目數目,則項目插入點後方的項目會向下移動,以容納新項目。

適用於