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); }
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; GCHandle.Alloc(notifyRealm); GCHandle.Alloc(getNativeSchema); GCHandle.Alloc(openRealm); NativeMethods.install_callbacks(notifyRealm, getNativeSchema, openRealm); }
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); }