public void Push(CLAction theAction) { stack[beg] = theAction; beg = (beg + 1) % StackSize; if (beg == end) { end = (end + 1) % StackSize; } }
private static void PushUndoAct(CLAction act) { undoStack.Push(act); OnUndoCountModified(); if (redoStack.Count > 0 && !redoing) { redoStack.Clear(); OnRedoCountModified(); } }
public static void RedoLastCanceledAction() { logger.ConditionalDebug("RedoLastCanceledAction"); CLAction act = redoStack.Pop(); if (act != null) { redoing = true; act.Redo(); OnRedoCountModified(); redoing = false; } }
/// <summary> /// Enregistre le fait que l'action <paramref name="act"/> est exécutée. /// </summary> /// <param name="act">L'action exécutée.</param> public static void ExceutingAction(CLAction act) { logger.ConditionalTrace("ExceutingAction {0}, undoing: {1}, disableRegistering: {2}", act.Name, undoing, disableRegistering); if (!undoing && disableRegistering == 0) { if (actList != null) { actList.Add(act); } else { PushUndoAct(act); } } }
/// <summary> /// Exécute l'annulation de la dernière action enregistrée. Ne fait rien s'il n'y a pas de /// dernière action à annuler. /// </summary> public static void UndoLastAction() { logger.ConditionalDebug("UndoLastAction"); logger.ConditionalTrace(undoStack.ToString()); CLAction act = undoStack.Pop(); if (act != null) { undoing = true; act.Undo(); OnUndoCountModified(); redoStack.Push(act); OnRedoCountModified(); undoing = false; } }
public void Add(CLAction theAction) { actList.Add(theAction); }