예제 #1
0
        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);
            }
        }
예제 #2
0
 public void CloseCompoundAction()
 {
     this.compound = null;
 }
예제 #3
0
 public CompoundCommand OpenCompoundAction(string name)
 {
     this.compound = new CompoundCommand(name);
     Add(this.compound);
     return(this.compound);
 }