mirror of
https://github.com/inthehand/32feet.git
synced 2026-10-19 23:29:51 +08:00
4bc5359bf0
* Rebuilt projects to build for .NET10.0 * Linker properties. Sample app replaced. Build/deploy confirmed * wrapped NSDate properties with DateTime. Added documentation * Added IOReturn constants and changed return types where appropriate. Split ApiDefinition into separate files for Bluetooth, Sdp, Obex and HandsFree to improve readability. * string constants * more refactoring and cleanup of API definitions. Updated project files with new NuGet properties for initial pre-release of 0.2 * Fixed delegate linker issue and continued with name updates * async device methods * Latest updates, naming etc and consistent return type for dialogs. * More updates --------- Co-authored-by: Peter Foot <sesa745161@se.com>
35 lines
985 B
C#
35 lines
985 B
C#
using System.Diagnostics;
|
|
using IOBluetooth;
|
|
using IOBluetoothUI;
|
|
|
|
namespace IOBluetoothSample;
|
|
|
|
[Register("AppDelegate")]
|
|
public class AppDelegate : NSApplicationDelegate
|
|
{
|
|
public override void DidFinishLaunching(NSNotification notification)
|
|
{
|
|
var hcontroller = IOBluetooth.HostController.DefaultController;
|
|
|
|
// Insert code here to initialize your application
|
|
foreach (var btdev in IOBluetooth.BluetoothDevice.PairedDevices)
|
|
{
|
|
Debug.WriteLine(btdev.Name);
|
|
}
|
|
|
|
var controller = new IOBluetoothUI.DeviceSelectorController();
|
|
var result = controller.RunModal();
|
|
if (result == (int)ModalResponse.Success)
|
|
{
|
|
NSAlert alert = new NSAlert(){ MessageText = controller.Results[0].Name};
|
|
alert.RunModal();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public override void WillTerminate(NSNotification notification)
|
|
{
|
|
// Insert code here to tear down your application
|
|
}
|
|
} |