public void Merge(CompoundCommand cmd) { // Replace the current command without upsetting rest of the redo stack // and insert the current command into this compound command. Command current = Peek(); if (current != null) { stack.Insert(pos - 1, cmd); stack.RemoveAt(pos); cmd.Do(); cmd.Insert(current); } else { Push(cmd); } }
public void CloseCompoundAction() { this.compound = null; }
public CompoundCommand OpenCompoundAction(string name) { this.compound = new CompoundCommand(name); Add(this.compound); return(this.compound); }