Exemplo n.º 1
0
        private void Hubs_ComStatusChanged(System.IO.Ports.SerialPort serialPort, Library.SerialPort.Status status)
        {
            Debug.WriteLine(status);

            switch (status)
            {
            case Library.SerialPort.Status.Opened:
                Dispatcher.Invoke(() =>
                {
                    _iconUsb.Blink(null);
                    _iconUsb.Color(Brushes.Green);
                });

                break;

            case Library.SerialPort.Status.Opening:
                Dispatcher.Invoke(() =>
                {
                    _iconUsb.Blink(1);
                    _iconUsb.Color(Brushes.Black);
                });

                break;

            case Library.SerialPort.Status.OpenError:
                Dispatcher.Invoke(() =>
                {
                    _iconUsb.Blink(0.1);
                    _iconUsb.Color(Brushes.Red);
                });

                break;
            }
        }
Exemplo n.º 2
0
 private void SerialPort_StatusChanged(System.IO.Ports.SerialPort serialPort, Library.SerialPort.Status status)
 {
     ComStatusChanged(serialPort, status);
 }