private void GetCommand(object sender, myEventArg e) { foreach (ComboBox i in comboBoxes) { if (i != null && i.Tag != null && i.Tag.ToString() == e.Command) { PerformCommand((i.Name.ToString()).Remove(0, 4), e.Position); DisplayMessage(e.Command, textBox1); } } }
private void ProcessMessage(string msg) { string[] msgArray = ConvertMsgToArray(msg); if (msg.StartsWith("Gaze|")) { ClientStatus.gazePoint.X = int.Parse(msgArray[0]); ClientStatus.gazePoint.Y = int.Parse(msgArray[1]); if (moveCursor) { Cursor.Position = Point.Add(ClientStatus.gazePoint, new Size(ClientStatus.ScreenTopLeft)); } } else if (msg.StartsWith("Commands|")) { CommandHandler temp = commandHandler; if (temp != null) { int X = int.Parse(msgArray[0]); int Y = int.Parse(msgArray[1]); myEventArg args = new myEventArg(msgArray[3], new Point(X, Y)); temp(this, args); } } else if (msg.StartsWith("Glyph|")) { if (msgArray[0] == "S") { //frm_glyph.Show(); frm_glyph.DisplayImage(true); // DisplayMessage("Show Glyph\r\n", textBox1); } else if (msgArray[0] == "H") { try { frm_glyph.DisplayImage(false); // DisplayMessage("Hide Glyph\r\n", textBox1); } catch (Exception) { } } } }