コード例 #1
0
ファイル: CLActionStack.cs プロジェクト: paColor/Colorization
 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
ファイル: CLActionList.cs プロジェクト: paColor/Colorization
 public void Add(CLAction theAction)
 {
     actList.Add(theAction);
 }