private void Form1_Load(object sender, System.EventArgs e) { setButtonEnabled = new setButtonEnabledHandler(setButtonEnabledMethod); setRcvText = new setTextHandler(setRcvTextMethod); setLabelStatus = new setLabelStatusHandler(setLabelStatusMethod); BluetoothRadio br = BluetoothRadio.PrimaryRadio; if (br == null) { MessageBox.Show("No supported Bluetooth radio/stack found."); btnListen.Enabled = false; } else if (br.Mode != InTheHand.Net.Bluetooth.RadioMode.Discoverable) { DialogResult rslt = MessageBox.Show("Make BluetoothRadio Discoverable?", "Bluetooth Remote Listener", MessageBoxButtons.YesNo); if (rslt == DialogResult.Yes) { br.Mode = RadioMode.Discoverable; } else { btnListen.Enabled = false; } } bl = new BluetoothListener(service); }
private void Form1_Load(object sender, System.EventArgs e) { setButtonEnabled = new setButtonEnabledHandler(setButtonEnabledMethod); setRcvText = new setTextHandler(setRcvTextMethod); setSendText = new setTextHandler(setSendTextMethod); setLabelStatus = new setLabelStatusHandler(setLabelStatusMethod); BluetoothRadio br = BluetoothRadio.PrimaryRadio; if (br == null) { MessageBox.Show("No supported Bluetooth radio/stack found."); btnListen.Enabled = false; } else if (br.Mode != InTheHand.Net.Bluetooth.RadioMode.Discoverable) { DialogResult rslt = MessageBox.Show("Make BluetoothRadio Discoverable?", "Bluetooth Remote Listener", MessageBoxButtons.YesNo); if (rslt == DialogResult.Yes) { br.Mode = RadioMode.Discoverable; } else btnListen.Enabled = false; } bl = new BluetoothListener(PANUService); }