Пример #1
0
 /// <summary>
 /// Call this method to redo the last undone operation
 /// </summary>
 public void Redo()
 {
     //AssertNoUndoGroupOpen();
     if (redostack.Count > 0)
     {
         ZYEditorAction uedit = (ZYEditorAction)redostack.Pop();
         undostack.Push(uedit);
         uedit.Redo();
         OnActionRedone();
     }
 }
Пример #2
0
        /// <summary>
        /// Call this method to push an UndoableOperation on the undostack, the redostack
        /// will be cleared, if you use this method.
        /// </summary>
        public void Push(ZYEditorAction operation)
        {
            if (operation == null)
            {
                throw new ArgumentNullException("operation");
            }

            if (AcceptChanges)
            {
                //StartUndoGroup();
                undostack.Push(operation);
                //actionCountInUndoGroup++;
                //if (myZYEditorControl != null)
                //{
                //    undostack.Push(new UndoableSetCaretPosition(this, myZYEditorControl.ActiveTextAreaControl.Caret.Position));
                //    actionCountInUndoGroup++;
                //}
                //EndUndoGroup();
                ClearRedoStack();
            }
        }
Пример #3
0
 public OperationEventArgs(ZYEditorAction op)
 {
     this.op = op;
 }