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); }
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)); }
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); }
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)); }