コード例 #1
0
 public virtual void Clear()
 {
     for (int num1 = this.myEdits.Count - 1; num1 >= 0; num1--)
     {
         IUndoableEdit edit1 = (IUndoableEdit)this.myEdits[num1];
         edit1.Clear();
     }
     this.myEdits.Clear();
 }
コード例 #2
0
 /// <summary>
 /// Clear all of the <see cref="IUndoableEdit"/>s and forget all references to them.
 /// </summary>
 public void Clear()
 {
     for (int i = this.Edits.Count - 1; i >= 0; i--)
     {
         IUndoableEdit edit = this.Edits[i];
         if (edit != null)
         {
             edit.Clear();
         }
     }
     this.Edits.Clear();
 }
コード例 #3
0
 public virtual void Clear()
 {
     for (int num1 = this.myCompEdits.Count - 1; num1 >= 0; num1--)
     {
         IUndoableEdit edit1 = (IUndoableEdit)this.myCompEdits[num1];
         edit1.Clear();
     }
     this.myCompEdits.Clear();
     this.myCurrentEditIndex = -1;
     this.myIncompleteEdit   = null;
     this.myLevel            = 0;
     this.myIsUndoing        = false;
     this.myIsRedoing        = false;
 }
コード例 #4
0
        public virtual bool EndTransaction(bool commit, string pname)
        {
            if (this.myLevel > 0)
            {
                this.myLevel--;
            }
            UndoManagerCompoundEdit edit1 = this.CurrentEdit;

            if ((this.myLevel == 0) && (edit1 != null))
            {
                if (commit)
                {
                    edit1.IsComplete = true;
                    if (edit1.AllEdits.Count > 0)
                    {
                        if (pname != null)
                        {
                            edit1.PresentationName = pname;
                        }
                        for (int num1 = this.myCompEdits.Count - 1; num1 > this.myCurrentEditIndex; num1--)
                        {
                            IUndoableEdit edit2 = (IUndoableEdit)this.myCompEdits[num1];
                            edit2.Clear();
                            this.myCompEdits.RemoveAt(num1);
                        }
                        if ((this.MaximumEditCount > 0) && (this.myCompEdits.Count >= this.MaximumEditCount))
                        {
                            IUndoableEdit edit3 = (IUndoableEdit)this.myCompEdits[0];
                            edit3.Clear();
                            this.myCompEdits.RemoveAt(0);
                            this.myCurrentEditIndex--;
                        }
                        this.myCompEdits.Add(edit1);
                        this.myCurrentEditIndex++;
                    }
                    this.CurrentEdit = null;
                    return(true);
                }
                edit1.Clear();
                this.CurrentEdit = null;
            }
            return(false);
        }