Example #1
0
        private async Task BTUpdate()
        {
            BluetoothDeviceInfo[] devices = null;
            try
            {
                SetBTButtons(false);
                bluehelp = new BluetoothHelper();
                await Task.Factory.StartNew(() => (devices = bluehelp.Search()));

                SetBTDevList(devices);
                bluetoothList.IsEnabled    = true;
                bluetoothconnect.IsEnabled = true;
                if (sqlitehelper.FileSource != null && bluehelp.IsConnected())
                {
                    runbtButton.IsEnabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            bluetoothupdate.IsEnabled = true;
        }
Example #2
0
 private async Task BTUpdate()
 {
     BluetoothDeviceInfo[] devices = null;
     try
     {
         SetBTButtons(false);
         bluehelp = new BluetoothHelper();
         await Task.Factory.StartNew(() => (devices = bluehelp.Search()));
         SetBTDevList(devices);
         bluetoothList.IsEnabled = true;
         bluetoothconnect.IsEnabled = true;
         if (sqlitehelper.FileSource != null && bluehelp.IsConnected())
             runbtButton.IsEnabled = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     bluetoothupdate.IsEnabled = true;
 }