コード例 #1
0
ファイル: MainForm.cs プロジェクト: GeorgeHahn/Hypertoken
        public MainForm(IAboutBox aboutBox,
                        ILogger logger,
                        CurrentDataDevice dataDevice,
                        WinformsMainMenuExtender mainMenuExtender,
                        IEnumerable<IStatusbarExtension> statusbarExtensions,
                        IEnumerable<IToolbarExtension> toolbarExtensions)
        {
            _aboutBox = aboutBox;
            _logger = logger;
            _mainMenuExtender = mainMenuExtender;
            _statusbarExtensions = statusbarExtensions;
            _toolbarExtensions = toolbarExtensions;

            _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;

            LogTo.Debug("Mainform object created");
        }
コード例 #2
0
 protected SerialStatusBarExtension(ISerialPort iSerialPort, CurrentDataDevice currentDataDevice)
 {
     _serialPort = iSerialPort;
     _serialPort.PropertyChanged += (sender, args) => UpdateStatusBarItem();
     _currentDataDevice = currentDataDevice;
     _currentDataDevice.PropertyChanged += (sender, args) => UpdateVisibility();
 }
コード例 #3
0
ファイル: HidMenu.cs プロジェクト: GeorgeHahn/Hypertoken
 public DeviceSelectionMenu(IDataDevice dataDevice, CurrentDataDevice terminal)
 {
     _dataDevice = dataDevice;
     _terminal = terminal;
     _dataDevice.PropertyChanged += (sender, args) => UpdateCheckedStates(args.PropertyName);
 }
コード例 #4
0
ファイル: SerialMenu.cs プロジェクト: GeorgeHahn/Hypertoken
 public PortMenu(ISerialPort serialPort, CurrentDataDevice terminal)
     : base(serialPort)
 {
     _dataDevice = terminal;
 }
コード例 #5
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 });
 }
コード例 #6
0
 public SerialStatusbarStatusLabel(ISerialPort serialPort, CurrentDataDevice currentDataDevice)
     : base(serialPort, currentDataDevice)
 {
 }
コード例 #7
0
 public SerialStatusbarPortMenu(ISerialPort iSerialPort, CurrentDataDevice currentDataDevice)
     : base(iSerialPort, currentDataDevice)
 {
 }