/* registers the callback func with the C code */ private bool register_nav_callback() { if (callback == null) { callback = new SHAKEEventCB(NavButtonCB_internal); } else { callback = null; } // NOTE that this is the STDCALL variation of the normal cdecl callback, // because the .NET Compact Framework doesn't support C delegates with non-stdcall // calling conventions. On XP, .NET 2.0 and above can handle it though. shake_register_event_callback_STDCALL(dev, callback); return true; }
public bool close() { if (!connected) return false; connected = false; register_nav_callback(); callback = null; shake_free_device(dev); return true; }
private static extern int shake_register_event_callback_STDCALL(IntPtr dev, SHAKEEventCB callback);