예제 #1
0
        public void Push(Command command)
        {
            ClearRedoStack();

            if (_commandQueue.Count > 0)
            {
                var mc = new MacroCommand(_commandQueue);
                mc.AddCommand(command);
                _commandQueue.Clear();
                _undoStack.Push(mc);
            }
            else
            {
                _undoStack.Push(command);
            }

            CheckChanged(true, _undoStack, OnUndoChange);
        }
예제 #2
0
        public void Push()
        {
            if (_commandQueue.Count == 0)
            {
                return;
            }

            Command command;

            if (_commandQueue.Count == 1)
            {
                command = _commandQueue.Dequeue();
            }
            else
            {
                command = new MacroCommand(_commandQueue);
                _commandQueue.Clear();
            }
            Push(command);
            OnCommit(new CommandCommitedEventArgs(command, CommandCommitType.Execute));
        }
예제 #3
0
        public void Push(Command command)
        {
            ClearRedoStack ();

            if (_commandQueue.Count > 0)
            {
                var mc = new MacroCommand (_commandQueue);
                mc.AddCommand (command);
                _commandQueue.Clear ();
                _undoStack.Push (mc);
            }
            else
                _undoStack.Push (command);

            CheckChanged (true, _undoStack, OnUndoChange);
        }
예제 #4
0
        public void Push()
        {
            if (_commandQueue.Count == 0)
                return;

            Command command;
            if (_commandQueue.Count == 1)
            {
                command = _commandQueue.Dequeue ();
            }
            else
            {
                command = new MacroCommand (_commandQueue);
                _commandQueue.Clear ();
            }
            Push (command);
            OnCommit (new CommandCommitedEventArgs(command,CommandCommitType.Execute));
        }