AI play

Playing with copilot last night and I will have to admit, I was amused andsomewhat impressed. Cool stuff.
AI generated C# simple sample BT class for wifi using Windows.Devices.Radios; using Windows.Devices.Bluetooth; using Windows.Devices.Enumeration; using System.Threading.Tasks; public class BlueManager { private async Task GetBluetoothRadioAsync() { var radios = await Radio.GetRadiosAsync(); foreach (var radio in radios) { if (radio.Kind == RadioKind.Bluetooth) { return radio; } } return null; } private async Task GetWifiRadioAsync() { var radios = await Radio.GetRadiosAsync(); foreach (var radio in radios) { if (radio.Kind == RadioKind.WiFi) { return radio; } } return null; } public async Task TurnOffWifiIfBluetoothDeviceNotNearby(string bluetoothDeviceId) { var bluetoothRadio = await GetBluetoothRadioAsync(); var wifiRadio = await GetWifiRadioAsync(); if (bluetoothRadio != null && wifiRadio != null) { var deviceWatcher = DeviceInformation.CreateWatcher( BluetoothDevice.GetDeviceSelectorFromPairingState(true)); deviceWatcher.Added += (sender, args) => { if (args.Id == bluetoothDeviceId) { // The specific Bluetooth device is nearby // Do nothing or turn on Wi-Fi if it's off } }; deviceWatcher.Removed += async (sender, args) => { if (args.Id == bluetoothDeviceId) { // The specific Bluetooth device is not nearby // Turn off Wi-Fi await wifiRadio.SetStateAsync(RadioState.Off); } }; deviceWatcher.Start(); } } }