static unsafe SharedRealmHandleExtensions() { NativeCommon.Initialize(); NativeMethods.RefreshAccessTokenCallbackDelegate refresh = RefreshAccessTokenCallback; NativeMethods.SessionErrorCallback error = HandleSessionError; NativeMethods.SessionProgressCallback progress = HandleSessionProgress; NativeMethods.SessionWaitCallback wait = HandleSessionWaitCallback; GCHandle.Alloc(refresh); GCHandle.Alloc(error); GCHandle.Alloc(progress); GCHandle.Alloc(wait); NativeMethods.install_syncsession_callbacks(refresh, error, progress, wait); NativeMethods.OpenRealmCallback openRealm = HandleOpenRealmCallback; GCHandle.Alloc(openRealm); NativeMethods.install_syncmanager_callbacks(openRealm); _logCallback = HandleLogMessage; GCHandle.Alloc(_logCallback); }
public static unsafe void InstallCallbacks() { NativeMethods.SessionErrorCallback error = HandleSessionError; NativeMethods.SessionProgressCallback progress = HandleSessionProgress; NativeMethods.SessionWaitCallback wait = HandleSessionWaitCallback; GCHandle.Alloc(error); GCHandle.Alloc(progress); GCHandle.Alloc(wait); NativeMethods.install_syncsession_callbacks(error, progress, wait); }
static unsafe SharedRealmHandleExtensions() { NativeMethods.RefreshAccessTokenCallbackDelegate refresh = RefreshAccessTokenCallback; NativeMethods.SessionErrorCallback error = HandleSessionError; NativeMethods.SessionProgressCallback progress = HandleSessionProgress; NativeMethods.SessionWaitCallback wait = HandleSessionWaitCallback; GCHandle.Alloc(refresh); GCHandle.Alloc(error); GCHandle.Alloc(progress); GCHandle.Alloc(wait); NativeMethods.install_syncsession_callbacks(refresh, error, progress, wait); }