private void timer2_Tick(object sender, EventArgs e) { if (CurrentClient != null) { try { var pos = pictureBox1.PointToClient(Cursor.Position); if (pictureBox1.ClientRectangle.IntersectsWith(new Rectangle(pos.X, pos.Y, 1, 1))) { pos = GetScaledCursor(); if (lastPoint.X != pos.X || lastPoint.Y != pos.Y) { lastPoint = pos; MessageProcessor.AddMessage(new MouseMoveMessage(pos)); } } } catch (Exception ex) { CurrentClient = null; MessageBox.Show("client lost"); } } }
public void AddMessage(Message m) { MessageProcessor.AddMessage(m); }