/// <summary>
 /// 撤销操作
 /// </summary>
 public virtual void Undo(XUndoEventArgs args)
 {
     if (objObjectValue != null && myProperty != null)
     {
         myProperty.SetValue(objObjectValue, objOldValue, null);
     }
 }
예제 #2
0
 /// <summary>
 /// 执行重复操作
 /// </summary>
 public virtual void Redo(XUndoEventArgs args)
 {
     foreach (IUndoable undo in myItems)
     {
         undo.InGroup = true;
         undo.Redo(args);
     }
 }
예제 #3
0
 /// <summary>
 /// 执行撤销操作
 /// </summary>
 public virtual void Undo(XUndoEventArgs args)
 {
     for (int iCount = myItems.Count - 1; iCount >= 0; iCount--)
     {
         IUndoable undo = ( IUndoable )myItems[iCount];
         undo.InGroup = true;
         undo.Undo(args);
         //( ( IUndoable )myItems[ iCount ]).Undo();
     }
 }
예제 #4
0
        /// <summary>
        /// 执行一次撤销操作
        /// </summary>
        public void Undo(XUndoEventArgs args)
        {
            if (intPosition < 0)
            {
                return;
            }
            bool back = bolLock;

            this.bolLock = true;
            try
            {
                IUndoable undo = this.Current;
                intPosition--;
                if (undo != null)
                {
                    undo.Undo(args);
                }
                OnStateChanged();
            }
            finally
            {
                bolLock = back;
            }
        }
예제 #5
0
        /// <summary>
        /// 执行一次重复操作
        /// </summary>
        public void Redo(XUndoEventArgs args)
        {
            if (intPosition >= this.Count)
            {
                return;
            }
            bool back = bolLock;

            bolLock = true;
            try
            {
                intPosition++;
                IUndoable undo = this.Current;
                if (undo != null)
                {
                    undo.Redo(args);
                }
                OnStateChanged();
            }
            finally
            {
                bolLock = back;
            }
        }
예제 #6
0
 /// <summary>
 /// 执行重复操作
 /// </summary>
 public override void Redo(DCSoft.CSharpWriter.Undo.XUndoEventArgs args)
 {
     Execute(false);
 }