Ejemplo n.º 1
0
 private void Controller_Sensor1Disconnected(object sender, Core.Network.DisconnectEventArgs e)
 {
     Sensor1Status.AsyncInvoke(x =>
     {
         x.BackColor = Color.OrangeRed;
     });
     Sensor1ConnectionStatus.AsyncInvoke(x =>
     {
         x.BackColor = Color.OrangeRed;
         x.Text      = "Connection Failed";
     });
     LogConsole.AsyncInvoke(x =>
     {
         if (!x.IsDisposed)
         {
             x.AppendText($"[{DateTime.Now}][NETWORK] : Disconnected From Sensor 1 as {e.IP}{Environment.NewLine}");
         }
     });
     Sensor1IpAddress.AsyncInvoke(x =>
     {
         x.Enabled = true;
     });
 }
Ejemplo n.º 2
0
 private void Controller_Sensor1Connected(object sender, Core.Network.ConnectEventArgs e)
 {
     controller.Sensor1IpAddress = e.IP;
     Sensor1Status.AsyncInvoke(x =>
     {
         x.BackColor = Color.OliveDrab;
     });
     Sensor1ConnectionStatus.AsyncInvoke(x =>
     {
         x.BackColor = Color.OliveDrab;
         x.Text      = "Connection Succeed";
     });
     LogConsole.AsyncInvoke(x =>
     {
         if (!x.IsDisposed)
         {
             x.AppendText($"[{DateTime.Now}][NETWORK] : Sensor 1 Connected as {e.IP}{Environment.NewLine}");
         }
     });
     Sensor1IpAddress.AsyncInvoke(x =>
     {
         x.Enabled = true;
     });
 }