private void Controller_Robot2Connected(object sender, Core.Network.ConnectEventArgs e) { Robot2Status.AsyncInvoke(x => { x.BackColor = Color.OliveDrab; }); LogConsole.AsyncInvoke(x => { if (!x.IsDisposed) { x.AppendText($"[{DateTime.Now}][NETWORK] : Robot 2 Connected as {e.IP}{Environment.NewLine}"); } }); }
private void Controller_Sensor2Connected(object sender, Core.Network.ConnectEventArgs e) { controller.Sensor2IpAddress = e.IP; Sensor2Status.AsyncInvoke(x => { x.BackColor = Color.OliveDrab; }); Sensor2ConnectionStatus.AsyncInvoke(x => { x.BackColor = Color.OliveDrab; x.Text = "Connection Succeed"; }); LogConsole.AsyncInvoke(x => { if (!x.IsDisposed) { x.AppendText($"[{DateTime.Now}][NETWORK] : Sensor 2 Connected as {e.IP}{Environment.NewLine}"); } }); Sensor2IpAddress.AsyncInvoke(x => { x.Enabled = true; }); }