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 项数小于零或大于集合中的项数。

value 集不是 null 集合的正确泛型类型 T

注解

如果等于 index 集合中的元素数,则该项将追加到列表中。 如果集合 index 中的元素数小于集合中的元素数,则项插入点后面的元素将向下移动以适应新元素。

适用于