private void AddPlayerToGrid(string serverSlot, string playerName, string steamId, string connectStatus, string disconnectTime) { if (grdPlayers.InvokeRequired) { AddGridRow i = new AddGridRow(AddPlayerToGrid); this.Invoke(i, new object[] { serverSlot, playerName, steamId, connectStatus, disconnectTime }); } else { grdPlayers.Rows.Add(serverSlot, playerName, steamId, connectStatus, disconnectTime); } }
public Form1() { InitializeComponent(); DoubleBuffered = true; RobotService.Program.NewLidarData += Program_NewLidarData; RobotService.Program.NewLocationPoint += Program_NewLocationPoint; RobotService.Program.NewLandmarkData += Program_NewLandmarkData; RobotService.Program.NewObstacleData += Program_NewObstacleData; RobotService.Program.StallDetected += Program_StallDetected; debugBindingList = new BindingList <double[]>(); //dataGridViewDebug.DataSource = debugBindingList; addGridRowDelegate = new AddGridRow(AddGridRowMethod); drawGUI = checkBoxUpdateGUI.Checked; updateList = checkBoxUpdateList.Checked; consoleThread = new Thread(() => RobotService.Program.Main(new string[0])); consoleThread.Name = "Console Thread"; consoleThread.Start(); }