コード例 #1
0
        public static BTDeviceInfo ShowBox(Window parent, bool pair = true)
        {
            BTSelect win = new BTSelect(parent, pair);

            win.ShowDialog();
            return(win.SelectedBT);
        }
コード例 #2
0
 private void DoDiscovery()
 {
     this.Title          = "Bluetooth";
     this.selectedDevice = BTSelect.ShowBox(this, true);
     if (this.selectedDevice != null)
     {
         this.Title = this.selectedDevice.Name;
     }
 }
コード例 #3
0
        private void btnUnpair_Click(object sender, RoutedEventArgs e)
        {
            BTDeviceInfo device = BTSelect.ShowBox(this, true);

            if (device != null)
            {
                var result = MsgBoxYesNo.ShowBox(
                    this, DI.Wrapper.GetText(LanguageFactory.Net.data.MsgCode.Unpair), device.Name);
                if (result == MsgBoxYesNo.MsgBoxResult.Yes)
                {
                    this.gridWait.Show();
                    DI.Wrapper.BT_UnPairStatus -= this.unPairStatusHandler;
                    DI.Wrapper.BT_UnPairStatus += this.unPairStatusHandler;
                    DI.Wrapper.BTClassicUnPairAsync(device);
                }
            }
        }