Example #1
0
 protected virtual void OnCollectionChangingCancel(NotifyCollectionChangedCancelEventArgs e)
 {
     if (CollectionChangingCancel != null)
     {
         CollectionChangingCancel(this, e);
     }
 }
Example #2
0
        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;
        }
Example #3
0
        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;
        }