示例#1
0
 /// <summary>
 /// Undoes the commands until the target to undo (from the last action).
 /// </summary>
 /// <param name="targetToUndo">The target to undo.</param>
 public void UndoCommandsUntil(CommandGeneric targetToUndo)
 {
     foreach (var com in CommandHistory.Reverse())
     {
         if(com.Done)
             com.Undo();   
         if (com == targetToUndo)
         {
             break;
         }
     }
 }
示例#2
0
 public void RedoCommandsUntil(CommandGeneric targetToRedo)
 {
     foreach (var com in CommandHistory)
     {
         if(!com.Done)
             com.Redo();
         if (com == targetToRedo)
         {
             break;
         }
     }
 }