Esempio n. 1
0
        static unsafe SharedRealmHandle()
        {
            NativeCommon.Initialize();

            SynchronizationContextScheduler.Install();

            NativeMethods.NotifyRealmCallback                notifyRealm                = NotifyRealmChanged;
            NativeMethods.GetNativeSchemaCallback            getNativeSchema            = GetNativeSchema;
            NativeMethods.OpenRealmCallback                  openRealm                  = HandleOpenRealmCallback;
            NativeMethods.OnBindingContextDestructedCallback onBindingContextDestructed = OnBindingContextDestructed;
            NativeMethods.LogMessageCallback                 logMessage                 = LogMessage;
            NotifiableObjectHandleBase.NotificationCallback  notifyObject               = NotifiableObjectHandleBase.NotifyObjectChanged;
            DictionaryHandle.KeyNotificationCallback         notifyDictionary           = DictionaryHandle.NotifyDictionaryChanged;
            MigrationCallback onMigration = OnMigration;

            GCHandle.Alloc(notifyRealm);
            GCHandle.Alloc(getNativeSchema);
            GCHandle.Alloc(openRealm);
            GCHandle.Alloc(onBindingContextDestructed);
            GCHandle.Alloc(logMessage);
            GCHandle.Alloc(notifyObject);
            GCHandle.Alloc(notifyDictionary);
            GCHandle.Alloc(onMigration);

            NativeMethods.install_callbacks(notifyRealm, getNativeSchema, openRealm, onBindingContextDestructed, logMessage, notifyObject, notifyDictionary, onMigration);
        }
        static unsafe SharedRealmHandle()
        {
            NativeCommon.Initialize();

            NativeMethods.NotifyRealmCallback                notifyRealm                = NotifyRealmChanged;
            NativeMethods.GetNativeSchemaCallback            getNativeSchema            = GetNativeSchema;
            NativeMethods.OpenRealmCallback                  openRealm                  = HandleOpenRealmCallback;
            NativeMethods.OnBindingContextDestructedCallback onBindingContextDestructed = OnBindingContextDestructed;

            GCHandle.Alloc(notifyRealm);
            GCHandle.Alloc(getNativeSchema);
            GCHandle.Alloc(openRealm);
            GCHandle.Alloc(onBindingContextDestructed);

            NativeMethods.install_callbacks(notifyRealm, getNativeSchema, openRealm, onBindingContextDestructed);
        }
Esempio n. 3
0
        static unsafe SharedRealmHandle()
        {
            NativeCommon.Initialize();

            SynchronizationContextScheduler.Install();

            NativeMethods.NotifyRealmCallback                notifyRealm                = NotifyRealmChanged;
            NativeMethods.GetNativeSchemaCallback            getNativeSchema            = GetNativeSchema;
            NativeMethods.OpenRealmCallback                  openRealm                  = HandleOpenRealmCallback;
            NativeMethods.OnBindingContextDestructedCallback onBindingContextDestructed = OnBindingContextDestructed;
            NativeMethods.LogMessageCallback                 logMessage                 = LogMessage;

            GCHandle.Alloc(notifyRealm);
            GCHandle.Alloc(getNativeSchema);
            GCHandle.Alloc(openRealm);
            GCHandle.Alloc(onBindingContextDestructed);
            GCHandle.Alloc(logMessage);

            NativeMethods.install_callbacks(notifyRealm, getNativeSchema, openRealm, onBindingContextDestructed, logMessage);
        }
Esempio n. 4
0
        public static void Initialize()
        {
            NativeMethods.NotifyRealmCallback                notifyRealm                = NotifyRealmChanged;
            NativeMethods.GetNativeSchemaCallback            getNativeSchema            = GetNativeSchema;
            NativeMethods.OpenRealmCallback                  openRealm                  = HandleOpenRealmCallback;
            NativeMethods.OnBindingContextDestructedCallback onBindingContextDestructed = OnBindingContextDestructed;
            NativeMethods.LogMessageCallback                 logMessage                 = LogMessage;
            NotifiableObjectHandleBase.NotificationCallback  notifyObject               = NotifiableObjectHandleBase.NotifyObjectChanged;
            DictionaryHandle.KeyNotificationCallback         notifyDictionary           = DictionaryHandle.NotifyDictionaryChanged;
            NativeMethods.MigrationCallback                  onMigration                = OnMigration;
            NativeMethods.ShouldCompactCallback              shouldCompact              = ShouldCompactOnLaunchCallback;

            GCHandle.Alloc(notifyRealm);
            GCHandle.Alloc(getNativeSchema);
            GCHandle.Alloc(openRealm);
            GCHandle.Alloc(onBindingContextDestructed);
            GCHandle.Alloc(logMessage);
            GCHandle.Alloc(notifyObject);
            GCHandle.Alloc(notifyDictionary);
            GCHandle.Alloc(onMigration);
            GCHandle.Alloc(shouldCompact);

            NativeMethods.install_callbacks(notifyRealm, getNativeSchema, openRealm, onBindingContextDestructed, logMessage, notifyObject, notifyDictionary, onMigration, shouldCompact);
        }