IListContract<T>.Insert(Int32, T) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在集合中的指定索引处插入项 IListContract<T> 。
public:
void Insert(int index, T item);
public void Insert(int index, T item);
abstract member Insert : int * 'T -> unit
Public Sub Insert (index As Integer, item As T)
参数
- index
- Int32
要插入 item的从零开始的索引。
- item
- T
要 IContract 插入集合中的 IListContract<T> 对象。
例外
注解
调用 Insert 该方法后,插入点后面的项将移动以适应新项。 移动的项的索引也会更新。 若要替换指定索引处的项,请使用 SetItem 该方法。
若要确定集合是否 IListContract<T> 为只读,请调用该方法 GetIsReadOnly 。