public static CFRunLoopSource CreateLimitedPowerSourceNotification(IOPowerSourceCallback callback, IntPtr context) { var sourceRef = IOPSCreateLimitedPowerNotification(callback, context); if (sourceRef == default) { return(null); } return(new CFRunLoopSource(sourceRef, true)); }
static extern IntPtr IOPSNotificationCreateRunLoopSource(IOPowerSourceCallback callback, IntPtr context);
public static CFRunLoopSource CreateLimitedPowerSourceNotification(IOPowerSourceCallback callback) => CreateLimitedPowerSourceNotification(callback, IntPtr.Zero);
internal static extern CFRunLoopSourceRef IOPSCreateLimitedPowerNotification(IOPowerSourceCallback callback, IntPtr context);