Пример #1
0
 public void Push(CLAction theAction)
 {
     stack[beg] = theAction;
     beg        = (beg + 1) % StackSize;
     if (beg == end)
     {
         end = (end + 1) % StackSize;
     }
 }
Пример #2
0
 private static void PushUndoAct(CLAction act)
 {
     undoStack.Push(act);
     OnUndoCountModified();
     if (redoStack.Count > 0 && !redoing)
     {
         redoStack.Clear();
         OnRedoCountModified();
     }
 }
Пример #3
0
        public static void RedoLastCanceledAction()
        {
            logger.ConditionalDebug("RedoLastCanceledAction");
            CLAction act = redoStack.Pop();

            if (act != null)
            {
                redoing = true;
                act.Redo();
                OnRedoCountModified();
                redoing = false;
            }
        }
Пример #4
0
 /// <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);
         }
     }
 }
Пример #5
0
        /// <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;
            }
        }
Пример #6
0
 public void Add(CLAction theAction)
 {
     actList.Add(theAction);
 }