Пример #1
0
 /// <summary>
 ///     Resets the connection.
 /// </summary>
 public async void ResetConnection()
 {
     try {
         if (IsConnected)
         {
             DisConnectFromWand();
         }
         else if (!ScanTimeOutElapsed)
         {
             Adapter.CancelScanning();
             DisConnectFromWand();
             UnRegisterEvents();
             await StopScanning();
         }
         else
         {
             UnRegisterEvents();
             SearchBlue2Devices();
         }
     } catch (Exception ex) {
         Debug.WriteLine("Error om reset connection {0}", ex.Message);
     }
 }