public void AddCommand(RipCommand command, IList <Rectangle> updates = null, bool direct = false) { if (this.Client != null && !direct) { if (sendCommands == null) { sendCommands = new Messages.SendCommands(this); } //Console.WriteLine ("Prepping command {0}", command); sendCommands.Commands.Add(command); } else { if (command is RipOptionalCommand && !RipDocument.OptionalApplied.Contains(command.OpCode)) { RipDocument.OptionalApplied.Add(command.OpCode); } //Console.WriteLine ("Adding command {0}", command); command.Apply(updates); RipDocument.Commands.Add(command); RipDocument.IsModified = true; if (!direct) { RedoBuffer.Clear(); } } }
public void FlushCommands(IList <Rectangle> updates = null) { if (sendCommands != null) { //Console.WriteLine ("Sending commands"); this.Client.SendCommand(sendCommands); sendCommands = null; } if (updates != null) { this.BGI.UpdateRegion(updates); } }