Saw a question on the Xwt.Mac group concerning getting Sleep and Wake events from MonoMac/C# on OS-X. Normally I would look for those event on the NSApplication default notification center, but a quick look at the Apple developer site quickly directed me to the those events being on the NSWorkspace’s notification center, so another quick look in MonoMac and lucky those are already exposed so you do not have to do the AddObserver work yourself, but finding them in the ‘online MonoMac API’ did not return any direct results(?)… So here is my answer from that group in case anyone else google/bing this in the future:
Sleep and Wake are available on the NSWorkspace’s notification center and MonoMac exposes those so so you do not have to write the AddObserver code yourself:
Apple Dev info on NSWorkspaceWillSleepNotification &NSWorkspaceDidWakeNotification
1 2 3 4 5 6 7 |
|