Ejemplo n.º 1
0
 protected virtual void OnCollectionChangingCancel(NotifyCollectionChangedCancelEventArgs e)
 {
     if (CollectionChangingCancel != null)
     {
         CollectionChangingCancel(this, e);
     }
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }