public void Add(CommandInfo cmd) { lock (_cmds) { _cmds.Enqueue(cmd); } }
private void PictureBox1MouseMove(object sender, MouseEventArgs e) { if (pictureBox1.BackgroundImage != null) { int cursorX = e.X * pictureBox1.BackgroundImage.Width / pictureBox1.Width; int cursorY = e.Y * pictureBox1.BackgroundImage.Height / pictureBox1.Height; string data = cursorX + "," + cursorY; CommandInfo cmd = new CommandInfo(CommandInfo.CommandTypeOption.MouseMove, data); ViewerService.Commands.Add(cmd); } }
public void Add(CommandInfo.CommandTypeOption type, string data) { CommandInfo cmd = new CommandInfo(type, data); Add(cmd); }
public static void Execute(CommandInfo cmd) { if (cmd.CommandType == CommandInfo.CommandTypeOption.MouseMove) { MouseMove(cmd.Data); } }