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 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); }
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); }
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); }