Ejemplo n.º 1
0
 private void ConnectedDevicesListener_DevicesChanged(object sender, DevicesChangedEventArgs e)
 {
     Now = e.Devices;
     App.Current.Dispatcher.Invoke(() =>
     {
         DeviceChangedSource?.Invoke(sender, e);
     });
 }
Ejemplo n.º 2
0
 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;
         }
     });
 }
Ejemplo n.º 3
0
 private void ConnectedDevicesChanged(object sender, DevicesChangedEventArgs e)
 {
     if (e.Devices.Count() == 0)
     {
         Devices = null;
     }
     else
     {
         Devices = e.Devices;
     }
 }
Ejemplo n.º 4
0
        private void OnDevicesChanged(object sender, DevicesChangedEventArgs e)
        {
            if (e.OldCount != e.NewCount)
            {
                // load the devices
                LoadDevices();

                LoadFeatures(DeviceList);

                Selections = Settings.Selections;
            }
        }
Ejemplo n.º 5
0
 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;
         }
     };
 }
Ejemplo n.º 6
0
        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;
                }
            };
        }
Ejemplo n.º 7
0
 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();
 }