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

            SetDataDevicePropertyChanged();
        }
Exemple #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");
        }
 protected SerialStatusBarExtension(ISerialPort iSerialPort, CurrentDataDevice currentDataDevice)
 {
     _serialPort = iSerialPort;
     _serialPort.PropertyChanged += (sender, args) => UpdateStatusBarItem();
     _currentDataDevice = currentDataDevice;
     _currentDataDevice.PropertyChanged += (sender, args) => UpdateVisibility();
 }
 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 });
 }
 public SerialStatusbarStatusLabel(ISerialPort serialPort, CurrentDataDevice currentDataDevice)
     : base(serialPort, currentDataDevice)
 {
 }
 public SerialStatusbarPortMenu(ISerialPort iSerialPort, CurrentDataDevice currentDataDevice)
     : base(iSerialPort, currentDataDevice)
 {
 }
Exemple #7
0
 public DeviceSelectionMenu(IDataDevice dataDevice, CurrentDataDevice terminal)
 {
     _dataDevice = dataDevice;
     _terminal = terminal;
     _dataDevice.PropertyChanged += (sender, args) => UpdateCheckedStates(args.PropertyName);
 }
Exemple #8
0
 public MainForm(IAboutBox aboutBox, CurrentDataDevice dataDevice, WinformsMainMenuExtender mainMenuExtender, IEnumerable<IStatusbarExtension> statusbarExtensions)
     : this(aboutBox, null, null, null, dataDevice, mainMenuExtender, statusbarExtensions)
 {
 }
Exemple #9
0
 public PortMenu(ISerialPort serialPort, CurrentDataDevice terminal)
     : base(serialPort)
 {
     _dataDevice = terminal;
 }