Inheritance: IDeviceInformationUpdate
コード例 #1
0
ファイル: UsbScopeDevice.cs プロジェクト: gazzyt/GaryScope
 private void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
 {
     if (Disconnected != null)
     {
         Disconnected();
     }
 }
コード例 #2
0
ファイル: HidGamepad.cs プロジェクト: bricelam/HidGamepad
        private static void HandleDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate args)
        {
            var gamepad = _gamepads[args.Id];

            _gamepads.Remove(args.Id);
            GamepadRemoved?.Invoke(sender, gamepad);
        }
コード例 #3
0
 private void DeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate args)
 {
     if (ExternalDeviceRemoved != null)
     {
         ExternalDeviceRemoved(this, args.Id);
     }
 }
コード例 #4
0
    private async void DevicesRemoved(DeviceWatcher sender, DeviceInformationUpdate args)
    {
      //Debug.WriteLine("Removed USB device: " + args.Id);

      await dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
      {
        UpdateDevices();
      });
    }
コード例 #5
0
        /// <summary>
        /// Invoked when the device watcher detects that the proximity sensor was removed.
        /// </summary>
        /// <param name="sender">The device watcher.</param>
        /// <param name="device">The device that was removed.</param>
        private void OnProximitySensorRemoved(DeviceWatcher sender, DeviceInformationUpdate device)
        {
            if ((this.proximitySensor != null) && (this.proximitySensor.DeviceId == device.Id))
            {
                this.proximitySensor.ReadingChanged -= ProximitySensor_ReadingChangedAsync;
                this.proximitySensor = null;

                SetActive(false);
            }
        }
コード例 #6
0
 private async void DeviceWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
 {
     await coreDispatcher.RunAsync(
         CoreDispatcherPriority.Normal,
         () =>
         {
             for (int index = 0; index < FoundDeviceList.Count; ++index)
             {
                 if (FoundDeviceList[index].Id == args.Id)
                 {
                     FoundDeviceList.RemoveAt(index);
                     break;
                 }
             }
         });
 }
コード例 #7
0
        private void SerialPortWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
        {
            isPortReady = false;
            
            try
            {
                dataWriter.Dispose();
                dataReader.Dispose();
                serialPort.Dispose();
            }
            catch { }

            dataWriter = null;
            dataReader = null;
            serialPort = null;
            frameReaderTask = null;

            SerialPortConnectionChanged?.Invoke(this, null);
        }
コード例 #8
0
ファイル: Blink1.cs プロジェクト: bricelam/ThingM.Blink1
 private static void HandleDeviceUpdated(DeviceWatcher sender, DeviceInformationUpdate args)
     => _devices[args.Id]._deviceInformation.Update(args);
コード例 #9
0
        public void Update(DeviceInformationUpdate deviceInfoUpdate)
        {
            deviceInfo.Update(deviceInfoUpdate);

            OnPropertyChanged("Kind");
            OnPropertyChanged("Id");
            OnPropertyChanged("Name");
            OnPropertyChanged("DeviceInformation");
            OnPropertyChanged("CanPair");
            OnPropertyChanged("IsPaired");
            OnPropertyChanged("DevicePairingStateText");
            OnPropertyChanged("PairButtonVisiblilty");
            OnPropertyChanged("UnpairButtonVisiblilty");
            UpdateGlyphBitmapImage();
        }
コード例 #10
0
 /// <summary>
 /// Update UI on device updated
 /// </summary>
 /// <param name="sender">The active DeviceWatcher instance</param>
 /// <param name="args">Event arguments</param>
 private async void DeviceWatcher_Updated(DeviceWatcher sender, DeviceInformationUpdate args)
 {
     // If all devices have been enumerated
     if (this.enumerationCompleted)
     {
         await coreDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
         {
             // Update the device list
             UpdateDevices();
         });
     }
 }
コード例 #11
0
ファイル: MainPage.xaml.cs プロジェクト: flecoqui/Windows10
 private void DeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate args)
 {
     LogMessage("Device Removed Id: " + args.Id);
 }
コード例 #12
0
ファイル: DeviceWatcher.cs プロジェクト: jokm1/uno-2
 private void Provider_WatchUpdated(object sender, DeviceInformationUpdate e) =>
 Updated?.Invoke(this, e);
コード例 #13
0
 private void DeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate args)
 {
     ExternalDeviceRemoved?.Invoke(this, args.Id);
 }
コード例 #14
0
 public void Update(DeviceInformationUpdate deviceInfoUpdate)
 {
     deviceInfo.Update(deviceInfoUpdate);
     UpdateGlyphBitmapImage();
 }
 private async void Watcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
 {
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         //Remove any removed devices from our listbox
         foreach (CastingDevice currentDevice in castingDevicesList.Items)
         {
             if (currentDevice.Id == args.Id)
             {
                 castingDevicesList.Items.Remove(currentDevice);
                 break;
             }
         }
     });
 }
コード例 #16
0
 private void watcher_Removed(Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformationUpdate args)
 {
     Debug.WriteLine(args.Id);
     this.BeginInvoke((Action)(() =>
     {
         //perform on the UI thread
         PrintDrives();
     }));
 }
コード例 #17
0
 /// <summary>
 /// Event handler for the removal of a scanner device
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="deviceInfo">The device info for the device which was added</param>
 private async void OnScannerRemoved(DeviceWatcher sender,  DeviceInformationUpdate deviceInfo)
 {
     await
     MainPage.Current.Dispatcher.RunAsync(
         Windows.UI.Core.CoreDispatcherPriority.Normal,
         () =>
         {
             var deviceId = deviceInfo.Id;
             MainPage.Current.NotifyUser(String.Format("Scanner with device id {0} has been removed", deviceId), NotifyType.StatusMessage);
             // Search the list of devices for one with a matching device id
             var match = FindInList(deviceId);
             if (match != null)
             {
                 // Remove the matched item
                 MainPage.Current.NotifyUser(String.Format("Scanner with device id {0} has been removed from list", deviceId), NotifyType.StatusMessage);
                 scannerInfoList.Remove(match);
             }
         }
     );
 }
コード例 #18
0
        private async void OnDeviceUpdated(DeviceWatcher deviceWatcher, DeviceInformationUpdate deviceInfoUpdate)
        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                _discoveryRWLock.EnterWriteLock();

                for (int idx = 0; idx < _discoveredDevices.Count; idx++)
                {
                    DiscoveredDevice devInfodisplay = _discoveredDevices[idx];
                    if (devInfodisplay.DeviceInfo.Id == deviceInfoUpdate.Id)
                    {
                        devInfodisplay.DeviceInfo.Update(deviceInfoUpdate);
                        break;
                    }
                }
            });
        }
コード例 #19
0
        private async void OnDeviceRemoved(DeviceWatcher deviceWatcher, DeviceInformationUpdate deviceInfoUpdate)
        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                _discoveryRWLock.EnterWriteLock();

                foreach (DiscoveredDevice devInfodisplay in _discoveredDevices)
                {
                    if (devInfodisplay.DeviceInfo.Id == deviceInfoUpdate.Id)
                    {
                        _discoveredDevices.Remove(devInfodisplay);
                        break;
                    }
                }

                _discoveryRWLock.ExitWriteLock();
            });
        }
コード例 #20
0
ファイル: Blink1.cs プロジェクト: bricelam/ThingM.Blink1
        private static void HandleDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate args)
        {
            var device = _devices[args.Id];

            _devices.Remove(args.Id);
            DeviceRemoved?.Invoke(sender, device);
        }
コード例 #21
0
 public void UpdateDeviceInfo(DeviceInformationUpdate update)
 {
     DeviceInfo.Update(update);
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("DisplayName"));
 }
 private async void DeviceWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate)
 {
     // We must update the collection on the UI thread because the collection is databound to a UI element.
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         // Protect against race condition if the task runs after the app stopped the deviceWatcher.
         if (sender == deviceWatcher)
         {
             // Find the corresponding DeviceInformation in the collection and remove it.
             BluetoothLEDeviceDisplay bleDeviceDisplay = FindBluetoothLEDeviceDisplay(deviceInfoUpdate.Id);
             if (bleDeviceDisplay != null)
             {
                 ResultCollection.Remove(bleDeviceDisplay);
             }
         }
     });
 }
        /// <summary>
        /// We will remove the device from the UI
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="deviceInformationUpdate"></param>
        private async void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
        {
            await rootPage.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                new DispatchedHandler(() =>
                {
                    rootPage.NotifyUser("Device removed - " + deviceInformationUpdate.Id, NotifyType.StatusMessage);

                    RemoveDeviceFromList(deviceInformationUpdate.Id);
                }));
        }
コード例 #24
0
        public void Update(DeviceInformationUpdate deviceInfoUpdate)
        {
            DeviceInformation.Update(deviceInfoUpdate);

            OnPropertyChanged("Id");
            OnPropertyChanged("Name");
            OnPropertyChanged("DeviceInformation");
            OnPropertyChanged("IsPaired");
            OnPropertyChanged("IsConnected");
            OnPropertyChanged("Properties");

            UpdateGlyphBitmapImage();
        }
コード例 #25
0
        public void Update(DeviceInformationUpdate deviceInfoUpdate)
        {
            deviceInfo.Update(deviceInfoUpdate);

            OnPropertyChanged("Kind");
            OnPropertyChanged("Id");
            OnPropertyChanged("Name");
            OnPropertyChanged("DeviceInformation");
            OnPropertyChanged("CanPair");
            OnPropertyChanged("IsPaired");

            UpdateGlyphBitmapImage();
        }
コード例 #26
0
        /// <summary>
        /// Invoked when the device watcher detects that the activity sensor was removed.
        /// </summary>
        /// <param name="sender">The device watcher.</param>
        /// <param name="device">The device that was removed.</param>
        private void OnActivitySensorRemoved(DeviceWatcher sender, DeviceInformationUpdate device)
        {
            if ((this.activitySensor != null) && (this.activitySensor.DeviceId == device.Id))
            {
                this.activitySensor.ReadingChanged -= ActivitySensor_ReadingChangedAsync;
                this.deviceAccessInformation.AccessChanged -= DeviceAccessInfo_AccessChangedAsync;
                this.activitySensor = null;

                SetActive(false);
            }
        }
コード例 #27
0
		private async void OnVideoDeviceWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
		{
			await UpdateIsCameraAvailableAsync().ConfigureAwait(false);
		}
コード例 #28
0
 private void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate update)
 {
   lock (this.devices)
   {
     this.devices.Remove(update.Id);
     if (this.devices.Count == 0)
       this.isCameraAvailable = false;
   }
 }
コード例 #29
0
 private async void DeviceWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
      => await this.ClearAudioFilesAsync();
コード例 #30
0
    private void OnDeviceUpdated(DeviceWatcher sender, DeviceInformationUpdate update)
    {
      object value;
      if (!update.Properties.TryGetValue("System.Devices.InterfaceEnabled", out value))
        return;

      lock (this.devices)
      {
        if ((bool)value)
          this.devices.Add(update.Id);
        else
          this.devices.Remove(update.Id);

        this.isCameraAvailable = this.devices.Count > 0;
      }
    }
コード例 #31
0
 private void Watcher_Updated(Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformationUpdate args)
 {
 }
コード例 #32
0
 /// <summary>
 /// Close the device that is opened so that all pending operations are canceled properly.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="deviceInformationUpdate"></param>
 private void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate deviceInformationUpdate)
 {
     if (IsDeviceConnected && (deviceInformationUpdate.Id == deviceInformation.Id))
     {
         // The main reasons to close the device explicitly is to clean up resources, to properly handle errors,
         // and stop talking to the disconnected device.
         CloseCurrentlyConnectedDevice();
     }
 }
コード例 #33
0
		private async void OnAudioDeviceWatcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args)
		{
			await UpdateIsMicrophoneAvailableAsync().ConfigureAwait(false);
		}