SynchronizedCollection<T>.InsertItem(Int32, T) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在指定的索引處插入一個項目。
protected:
virtual void InsertItem(int index, T item);
protected virtual void InsertItem(int index, T item);
abstract member InsertItem : int * 'T -> unit
override this.InsertItem : int * 'T -> unit
Protected Overridable Sub InsertItem (index As Integer, item As T)
參數
- index
- Int32
物件要插入的集合的零基索引。
- item
- T
要插入收藏的物件。
例外狀況
指定的是 index 小於零或大於集合中項目數量。
值集是否 null 屬於該集合的正確通用型別 T 。
備註
若 等 index 於集合中的元素數,則該項目會附加到清單中。 若 小 index 於集合中元素數量,則插入點後的元素會向下移動以容納新元素。