語言

DataServiceCollection<T>.InsertItem(Int32, T) 方法

定義

在指定的索引處將指定項目加入集合。

protected:
 override void InsertItem(int index, T item);
protected override void InsertItem(int index, T item);
override this.InsertItem : int * 'T -> unit
Protected Overrides Sub InsertItem (index As Integer, item As T)

參數

index
Int32

索引該在哪裡加入該項目。

item
T

要新增的項目。

備註

當你手動追蹤收藏變更時,必須覆寫這個 InsertItem 方法,以防止項目自動加入收藏。

適用於