protected override void InsertItem(int index, T item) { ValidateItem(item); var args = new CollectionItemEventArgs <T>(item); OnItemAdding(args); base.InsertItem(index, item); OnItemAdded(args); OnChanged(); }
protected override void RemoveItem(int index) { var item = this[index]; var args = new CollectionItemEventArgs <T>(item); OnItemRemoving(args); base.RemoveItem(index); OnItemRemoved(args); OnChanged(); }
protected override void SetItem(int index, T item) { ValidateItem(item); var oldItem = this[index]; var removeArgs = new CollectionItemEventArgs <T>(oldItem); OnItemRemoving(removeArgs); var addArgs = new CollectionItemEventArgs <T>(item); OnItemAdding(addArgs); base.SetItem(index, item); OnItemRemoved(removeArgs); OnItemAdded(addArgs); OnChanged(); }
protected virtual void OnItemRemoved(CollectionItemEventArgs <T> args) { Fire(ItemRemoved, args); }
protected void OnItemRemoving(CollectionItemEventArgs <T> args) { Fire(ItemRemoving, args); }