Esempio n. 1
0
        private async void button_Click(object sender, RoutedEventArgs e)
        {
            //var devices = await InTheHand.Devices.Enumeration.DeviceInformation.FindAllAsync();

            InTheHand.Devices.Enumeration.DevicePicker p = new InTheHand.Devices.Enumeration.DevicePicker();
            p.Filter.SupportedDeviceSelectors.Add(InTheHand.Devices.Bluetooth.BluetoothDevice.GetDeviceSelectorFromPairingState(false));
            //p.Filter.SupportedDeviceSelectors.Add(InTheHand.Devices.Bluetooth.BluetoothDevice.GetDeviceSelectorFromClassOfDevice(InTheHand.Devices.Bluetooth.BluetoothClassOfDevice.FromRawValue(0x104)));
            var d = await p.PickSingleDeviceAsync(new InTheHand.Foundation.Rect());

            if (d != null)
            {
                InTheHand.Devices.Bluetooth.BluetoothDevice bd = await InTheHand.Devices.Bluetooth.BluetoothDevice.FromDeviceInformationAsync(d);

                Debug.WriteLine(d.Pairing.IsPaired);
                if (!d.Pairing.IsPaired)
                {
                    var pairresult = await d.Pairing.PairAsync();

                    /*d.Pairing.Custom.PairingRequested += Custom_PairingRequested;
                     * await d.Pairing.Custom.PairAsync(InTheHand.Devices.Enumeration.DevicePairingKinds.ProvidePin);*/
                }
                Debug.WriteLine(bd.ClassOfDevice.MinorClass);
                Debug.WriteLine(bd.ClassOfDevice);
            }

            /*InTheHand.Storage.Pickers.FileOpenPicker fop = new InTheHand.Storage.Pickers.FileOpenPicker();
             * fop.FileTypeFilter.Add(".txt");
             * fop.FileTypeFilter.Add(".cs");
             * var file = await fop.PickSingleFileAsync();*/

            /* InTheHand.Storage.Pickers.FileSavePicker fsp = new InTheHand.Storage.Pickers.FileSavePicker();
             * fsp.FileTypeChoices.Add("Text file", new List<string> { ".txt", ".csv" });
             * fsp.DefaultFileExtension = ".txt";
             * var savefile = await fsp.PickSaveFileAsync();*/

            InTheHand.Storage.Pickers.FolderPicker fp = new InTheHand.Storage.Pickers.FolderPicker();


            var folder = await fp.PickSingleFolderAsync();
        }
Esempio n. 2
0
 async void Search_Clicked(object sender, EventArgs e)
 {
     InTheHand.Devices.Enumeration.DevicePicker p = new InTheHand.Devices.Enumeration.DevicePicker();
     var device = await p.PickSingleDeviceAsync();
 }