Example #1
0
        void ICancelAddNew.EndNew(int itemIndex)
        {
            ICancelAddNew i = collection as ICancelAddNew;

            i.EndNew(itemIndex);

            if (entitiesFilterBackup != null)
            {
                i = entitiesFilterBackup as ICancelAddNew;
                i.EndNew(itemIndex);
            }
        }
Example #2
0
 void ICancelAddNew.CancelNew(int position)
 {
     if (this.currencyManager != null)
     {
         ICancelAddNew list = this.currencyManager.List as ICancelAddNew;
         if (list != null)
         {
             list.CancelNew(position);
             return;
         }
     }
     this.RemoveAt(position);
 }
Example #3
0
        //private T _newItem;

        //void ICancelAddNew.CancelNew(int itemIndex)
        //{
        //  if (_newItem != null)
        //    Remove(_newItem);
        //}

        //void ICancelAddNew.EndNew(int itemIndex)
        //{
        //  // do nothing
        //}

        void ICancelAddNew.CancelNew(int itemIndex)
        {
            ICancelAddNew can = _list as ICancelAddNew;

            if (can != null)
            {
                can.CancelNew(OriginalIndex(itemIndex));
            }
            else
            {
                _list.RemoveAt(OriginalIndex(itemIndex));
            }
        }
Example #4
0
        void ICancelAddNew.EndNew(int position)
        {
            if (this.currencyManager != null)
            {
                ICancelAddNew list = this.currencyManager.List as ICancelAddNew;
                if (list != null)
                {
                    list.EndNew(position);
                }
            }

            if (position >= 0 && position < this.Count)
            {
                this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, this[position], position));
            }
        }
Example #5
0
 public override void EndCurrentEdit()
 {
     if ((this.Count > 0) && this.CurrencyManager_PullData())
     {
         object          obj2 = ((this.Position >= 0) && (this.Position < this.list.Count)) ? this.list[this.Position] : null;
         IEditableObject obj3 = obj2 as IEditableObject;
         if (obj3 != null)
         {
             obj3.EndEdit();
         }
         ICancelAddNew list = this.list as ICancelAddNew;
         if (list != null)
         {
             list.EndNew(this.Position);
         }
     }
 }
Example #6
0
        void ICancelAddNew.CancelNew(int pos)
        {
            if (!shouldreset || !info.Groups.IsNewRow(pos))
            {
                return;
            }

            ICancelAddNew list = this.List as ICancelAddNew;

            if (list != null)
            {
                suspendlistchange++;
                try
                {
                    int li = List.IndexOf(this[pos]);
                    list.CancelNew(li);
                }
                finally { suspendlistchange--; }
            }

            RemoveAt(pos);
        }
Example #7
0
 public override void CancelCurrentEdit()
 {
     if (this.Count > 0)
     {
         object          obj2 = ((this.Position >= 0) && (this.Position < this.list.Count)) ? this.list[this.Position] : null;
         IEditableObject obj3 = obj2 as IEditableObject;
         if (obj3 != null)
         {
             obj3.CancelEdit();
         }
         ICancelAddNew list = this.list as ICancelAddNew;
         if (list != null)
         {
             list.CancelNew(this.Position);
         }
         this.OnItemChanged(new ItemChangedEventArgs(this.Position));
         if (this.Position != -1)
         {
             this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, this.Position));
         }
     }
 }
Example #8
0
        /// <include file='doc\ListManager.uex' path='docs/doc[@for="CurrencyManager.EndCurrentEdit"]/*' />
        /// <devdoc>
        ///    <para>Ends the current edit operation.</para>
        /// </devdoc>
        public override void EndCurrentEdit()
        {
            if (Count > 0)
            {
                bool success = CurrencyManager_PullData();

                if (success)
                {
                    object item = (Position >= 0 && Position < list.Count) ? list[Position] : null;

                    IEditableObject iEditableItem = item as IEditableObject;
                    if (iEditableItem != null)
                    {
                        iEditableItem.EndEdit();
                    }

                    ICancelAddNew iListWithCancelAddNewSupport = list as ICancelAddNew;
                    if (iListWithCancelAddNewSupport != null)
                    {
                        iListWithCancelAddNewSupport.EndNew(this.Position);
                    }
                }
            }
        }
Example #9
0
 protected override void OnStart(string[] args)
 {
     ICancelAddNew.Equals("", "");
 }