示例#1
0
 public void Redo()
 {
     if (redoStack.Count > 0)
     {
         UndoEngine.UndoUnit unit = redoStack.Pop();
         unit.Undo();
         undoStack.Push(unit);
     }
 }
 public void Undo()
 {
     if (this.undoStack.Count > 0)
     {
         UndoEngine.UndoUnit item = this.undoStack.Pop();
         item.Undo();
         this.redoStack.Push(item);
     }
 }
 public void DoRedo()
 {
     if (currentPos < undoUnitList.Count)
     {
         UndoEngine.UndoUnit undoUnit = undoUnitList[currentPos];
         undoUnit.Undo();
         currentPos++;
     }
     UpdateUndoRedoMenuCommandsStatus();
 }
 public void DoUndo()
 {
     if (currentPos > 0)
     {
         UndoEngine.UndoUnit undoUnit = undoUnitList[currentPos - 1];
         undoUnit.Undo();
         currentPos--;
     }
     UpdateUndoRedoMenuCommandsStatus();
 }
 public void DoRedo()
 {
     if (this.currentPos < this.undoUnitList.Count)
     {
         UndoEngine.UndoUnit undoUnit = this.undoUnitList[this.currentPos];
         undoUnit.Undo();
         this.currentPos++;
     }
     this.UpdateUndoRedoMenuCommandsStatus();
 }
 public void DoUndo()
 {
     if (this.currentPos > 0)
     {
         UndoEngine.UndoUnit undoUnit = this.undoUnitList[this.currentPos - 1];
         undoUnit.Undo();
         this.currentPos--;
     }
     this.UpdateUndoRedoMenuCommandsStatus();
 }
示例#7
0
 public void Undo()
 {
     if (undoStack.Count > 0)
     {
         UndoEngine.UndoUnit unit = undoStack.Pop();
         undoUnitName = unit.Name;
         unit.Undo();
         redoStack.Push(unit);
     }
 }
示例#8
0
 public void Redo()
 {
     if (redoStack.Count > 0)
     {
         try {
             UndoEngine.UndoUnit unit = redoStack.Pop();
             unit.Undo();
             undoStack.Push(unit);
             //Log("::Redo - redo action performed: " + unit.Name);
         }
         catch  {
             //Log("::Redo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")");
         }
     }
     else
     {
         //Log("::Redo - NO redo action to perform!");
     }
 }
示例#9
0
 public void Undo()
 {
     if (undoStack.Count > 0)
     {
         try {
             UndoEngine.UndoUnit unit = undoStack.Pop();
             unit.Undo();
             redoStack.Push(unit);
             //Log("::Undo - undo action performed: " + unit.Name);
         }
         catch (Exception ex) {
             Debug.WriteLine(_Name_ + ex.Message);
             //Log("::Undo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")");
         }
     }
     else
     {
         //Log("::Undo - NO undo action to perform!");
     }
 }
示例#10
0
 public void Redo( )
 {
     if (redoStack.Count > 0)
     {
         try
         {
             UndoEngine.UndoUnit unit = redoStack.Pop();
             unit.Undo();
             undoStack.Push(unit);
             //Update the CanUndo and CanRedo state
             CanUndo = undoStack.Count == 0?false:true;
             CanRedo = redoStack.Count == 0?false:true;
             //Log("::Redo - redo action performed: " + unit.Name);
         }
         catch (Exception ex)
         {
             //Log("::Redo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")");
         }
     }
     else
     {
         //Log("::Redo - NO redo action to perform!");
     }
 }