Exemplo n.º 1
0
 private void OnConnectionStatusChanged(BluetoothLEDevice sender, object args)
 {
     if (sender.ConnectionStatus == BluetoothConnectionStatus.Disconnected)
     {
         Disconnect();
         DeviceRemovedEvent?.Invoke(this, sender.DeviceId);
     }
 }
Exemplo n.º 2
0
        internal async Task WaitForRemoval()
        {
            LogFile.Log("Waiting for phone to disconnect...", LogType.FileOnly);

            await Task.Run(() =>
            {
                System.Threading.AutoResetEvent e = new System.Threading.AutoResetEvent(false);
                DeviceRemovedEvent Removed        = () =>
                {
                    e.Set();
                };
                DeviceRemoved += Removed;
                e.WaitOne();
                DeviceRemoved -= Removed;
            });
        }
Exemplo n.º 3
0
 public void RaiseDeviceRemovedEvent(IChannel channel)
 {
     Services.DispatcherServices.Invoke(() => DeviceRemovedEvent?.Invoke(this, channel));
 }
Exemplo n.º 4
0
 private void AudioControllerOnDeviceRemoved(object sender, DeviceRemovedEvent deviceRemovedEvent)
 {
     _needUpdate = true;
 }
Exemplo n.º 5
0
 private void AudioControllerOnDeviceRemoved(object sender, DeviceRemovedEvent deviceRemovedEvent)
 {
     _needUpdate = true;
 }
Exemplo n.º 6
0
 private void AudioController_DeviceRemoved(object sender, DeviceRemovedEvent e)
 {
     RefreshDevices();
 }