StateManagedCollection.IList.Insert(Int32, Object) 方法

定义

将项在指定索引处插入 StateManagedCollection 集合中。Inserts an item into the StateManagedCollection collection at the specified index.

 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 的从零开始的索引。The zero-based index at which value should be inserted.

value
Object

要插入到 StateManagedCollection 中的对象。The object to insert into the StateManagedCollection.

实现

例外

指定的 index 超出了集合的范围。The specified index is out of range of the collection.

指定的 valuenullThe specified value is null.

注解

如果 index 为-1, value 则将追加到集合的开头 StateManagedCollectionIf index is -1, value is appended to the beginning of the StateManagedCollection collection. 如果 index 等于集合中的项数, value 则将追加到集合的末尾。If index equals the number of items in the collection, value is appended to the end of the collection.

适用于

另请参阅