private void ConnectedDevicesListener_DevicesChanged(object sender, DevicesChangedEventArgs e) { Now = e.Devices; App.Current.Dispatcher.Invoke(() => { DeviceChangedSource?.Invoke(sender, e); }); }
private void _monitor_DevicesChanged(object sender, DevicesChangedEventArgs e) { this.Dispatcher.Invoke(() => { this.ListBoxMain.ItemsSource = e.DevicesList; if (ListBoxMain.SelectedIndex == -1 && e.DevicesList.Count() > 0) { ListBoxMain.SelectedIndex = 0; } }); }
private void ConnectedDevicesChanged(object sender, DevicesChangedEventArgs e) { if (e.Devices.Count() == 0) { Devices = null; } else { Devices = e.Devices; } }
private void OnDevicesChanged(object sender, DevicesChangedEventArgs e) { if (e.OldCount != e.NewCount) { // load the devices LoadDevices(); LoadFeatures(DeviceList); Selections = Settings.Selections; } }
public HidSharpDeviceRootHub() { DeviceList.Local.Changed += (sender, e) => { var newList = DeviceList.Local.GetHidDevices().Select(d => new HidSharpEndpoint(d)); var changes = new DevicesChangedEventArgs(hidDevices, newList); if (changes.Changes.Any()) { DevicesChanged?.Invoke(this, changes); hidDevices = newList; } }; }
public Driver() { Info.GetDriverInstance = () => this; DeviceList.Local.Changed += (sender, e) => { var newList = DeviceList.Local.GetHidDevices(); var changes = new DevicesChangedEventArgs(CurrentDevices, newList); if (changes.Any()) { DevicesChanged?.Invoke(this, changes); CurrentDevices = newList; } }; }
private void ConnectedDevicesChanged(object sender, DevicesChangedEventArgs e) { Devices = e.Devices; }
////////////////////////////////////////////////////////////////////////////// // If we got a device changed lets update our list boxes to reflect the // new current state. ////////////////////////////////////////////////////////////////////////////// void Experiment_DeviceChanged(object sender, DevicesChangedEventArgs e) { RefreshListBoxes(); }