private void Controller_Sensor2Disconnected(object sender, Core.Network.DisconnectEventArgs e) { Sensor2Status.AsyncInvoke(x => { x.BackColor = Color.OrangeRed; }); Sensor2ConnectionStatus.AsyncInvoke(x => { x.BackColor = Color.OrangeRed; x.Text = "Connection Failed"; }); LogConsole.AsyncInvoke(x => { if (!x.IsDisposed) { x.AppendText($"[{DateTime.Now}][NETWORK] : Disconnected From Sensor 2 as {e.IP}{Environment.NewLine}"); } }); Sensor2IpAddress.AsyncInvoke(x => { x.Enabled = true; }); }
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; }); }