public CurrentDeviceSerialStatusLabel(CurrentDataDevice terminal)
        {
            _terminal = terminal;
            _terminal.PropertyChanged += (sender, args) =>
                                             {
                                                 if (args.PropertyName == "CurrentDevice")
                                                 {
                                                     SetDataDevicePropertyChanged();
                                                     UpdateLabel();
                                                 }
                                             };

            SetDataDevicePropertyChanged();
        }
Ejemplo n.º 2
0
        public MainForm(IAboutBox aboutBox,
                        ILogger logger,
                        IEchoer echoer,
                        IFileSender fileSender,
                        CurrentDataDevice dataDevice,
                        WinformsMainMenuExtender mainMenuExtender,
                        IEnumerable<IStatusbarExtension> statusbarExtensions)
        {
            _aboutBox = aboutBox;
            _logger = logger;
            _echoer = echoer;
            _fileSender = fileSender;
            _mainMenuExtender = mainMenuExtender;
            _statusbarExtensions = statusbarExtensions;

            _currentDataDevice = dataDevice;
            _currentDataDevice.PropertyChanged += (sender, args) =>
                                                    {
                                                        var oldDataDevice = _dataDevice;
                                                        _dataDevice = _currentDataDevice.CurrentDevice;
                                                        if (_dataDevice != null)
                                                        {
                                                            _dataDevice.PropertyChanged += DataDeviceOnPropertyChanged;
                                                            _dataDevice.DataReceived += DataDeviceOnDataReceived;
                                                        }
                                                        if (oldDataDevice != null)
                                                        {
                                                            oldDataDevice.PropertyChanged -= DataDeviceOnPropertyChanged;
                                                            oldDataDevice.DataReceived -= DataDeviceOnDataReceived;
                                                        }
                                                    };

            _dataDevice = _currentDataDevice.CurrentDevice;

            Log.Debug("Mainform object created");
        }
Ejemplo n.º 3
0
 protected SerialStatusBarExtension(ISerialPort iSerialPort, CurrentDataDevice currentDataDevice)
 {
     _serialPort = iSerialPort;
     _serialPort.PropertyChanged += (sender, args) => UpdateStatusBarItem();
     _currentDataDevice = currentDataDevice;
     _currentDataDevice.PropertyChanged += (sender, args) => UpdateVisibility();
 }
Ejemplo n.º 4
0
 public SerialStatusbarBaudMenu(ISerialPort serialPort, CurrentDataDevice currentDataDevice)
     : base(serialPort, currentDataDevice)
 {
     _baudRates = new List<int>(new[] { 110, 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 });
 }
Ejemplo n.º 5
0
 public SerialStatusbarStatusLabel(ISerialPort serialPort, CurrentDataDevice currentDataDevice)
     : base(serialPort, currentDataDevice)
 {
 }
Ejemplo n.º 6
0
 public SerialStatusbarPortMenu(ISerialPort iSerialPort, CurrentDataDevice currentDataDevice)
     : base(iSerialPort, currentDataDevice)
 {
 }
Ejemplo n.º 7
0
 public DeviceSelectionMenu(IDataDevice dataDevice, CurrentDataDevice terminal)
 {
     _dataDevice = dataDevice;
     _terminal = terminal;
     _dataDevice.PropertyChanged += (sender, args) => UpdateCheckedStates(args.PropertyName);
 }
Ejemplo n.º 8
0
 public MainForm(IAboutBox aboutBox, CurrentDataDevice dataDevice, WinformsMainMenuExtender mainMenuExtender, IEnumerable<IStatusbarExtension> statusbarExtensions)
     : this(aboutBox, null, null, null, dataDevice, mainMenuExtender, statusbarExtensions)
 {
 }
Ejemplo n.º 9
0
 public PortMenu(ISerialPort serialPort, CurrentDataDevice terminal)
     : base(serialPort)
 {
     _dataDevice = terminal;
 }