protected virtual void OnCollectionChangingCancel(NotifyCollectionChangedCancelEventArgs e) { if (CollectionChangingCancel != null) { CollectionChangingCancel(this, e); } }
protected void BeginInsertItem(int index, ItemType item, out bool isCancel) { isCancel = false; NotifyCollectionChangedCancelEventArgs e = new NotifyCollectionChangedCancelEventArgs(NotifyCollectionChangedAction.Add, item, index); OnCollectionChangingCancel(e); if (e.IsCancel) { isCancel = true; return; } OnCollectionChanging(e); m_IsBeginOperationExecuted = true; }
protected void BeginRemoveItem(int index, out bool isCancel) { isCancel = false; NotifyCollectionChangedCancelEventArgs e = new NotifyCollectionChangedCancelEventArgs(NotifyCollectionChangedAction.Remove, this[index], index); OnCollectionChangingCancel(e); if (e.IsCancel) { isCancel = true; return; } OnCollectionChanging(e); m_IsBeginOperationExecuted = true; }