Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }