示例#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);
        }
示例#2
0
        static SharedRealmHandle()
        {
            NativeCommon.Initialize();

            NativeMethods.NotifyRealmCallback     notifyRealm     = NotifyRealmChanged;
            NativeMethods.GetNativeSchemaCallback getNativeSchema = GetNativeSchema;

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

            NativeMethods.install_callbacks(notifyRealm, getNativeSchema);
        }
        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);
        }
示例#4
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);
        }
示例#5
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);
        }