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); }
internal Exception Convert(Func <RealmExceptionCodes, Exception> overrider = null) { var message = (messageLength != IntPtr.Zero) ? Encoding.UTF8.GetString(messageBytes, (int)messageLength) : "No further information available"; NativeCommon.delete_pointer(messageBytes); return(overrider?.Invoke(type) ?? RealmException.Create(type, message)); }
static Realm() { RealmObjectClasses = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(a => a.GetTypes()) .Where(t => t.IsSubclassOf(typeof(RealmObject))) .ToArray(); ObjectSchemaCache = new Dictionary <Type, IntPtr>(); NativeCommon.Initialize(); NativeCommon.register_notify_realm_changed(NotifyRealmChanged); }
static Realm() { NativeCommon.Initialize(); NativeCommon.NotifyRealmCallback notifyRealm = RealmState.NotifyRealmChanged; GCHandle.Alloc(notifyRealm); NativeCommon.register_notify_realm_changed(notifyRealm); SynchronizationContextEventLoopSignal.Install(); }
static SharedRealmHandle() { NativeCommon.Initialize(); NativeMethods.NotifyRealmCallback notifyRealm = NotifyRealmChanged; NativeMethods.GetNativeSchemaCallback getNativeSchema = GetNativeSchema; GCHandle.Alloc(notifyRealm); GCHandle.Alloc(getNativeSchema); NativeMethods.install_callbacks(notifyRealm, getNativeSchema); }
static Realm() { NativeCommon.Initialize(); NativeCommon.NotifyRealmCallback notifyRealm = RealmState.NotifyRealmChanged; GCHandle.Alloc(notifyRealm); NativeCommon.GetNativeSchemaCallback getNativeSchema = GetNativeSchema; GCHandle.Alloc(getNativeSchema); NativeCommon.register_callbacks(notifyRealm, getNativeSchema); SynchronizationContextEventLoopSignal.Install(); }
static Realm() { RealmObjectClasses = AppDomain.CurrentDomain.GetAssemblies() #if !__IOS__ // we need to exclude dynamic assemblies. see https://bugzilla.xamarin.com/show_bug.cgi?id=39679 .Where(a => !(a is System.Reflection.Emit.AssemblyBuilder)) #endif .SelectMany(a => a.GetTypes()) .Where(t => t.IsSubclassOf(typeof(RealmObject))) .ToArray(); ObjectSchemaCache = new Dictionary <Type, IntPtr>(); NativeCommon.Initialize(); NativeCommon.register_notify_realm_changed(NotifyRealmChanged); }
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); }
static unsafe SharedRealmHandle() { NativeCommon.Initialize(); }
static Realm() { NativeCommon.Initialize(); NativeCommon.register_notify_realm_changed(NotifyRealmChanged); }
static Realm() { NativeCommon.Initialize(); NativeCommon.register_notify_realm_changed(NotifyRealmChanged); NativeCommon.register_notify_realm_object_changed(RealmObject.NotifyRealmObjectPropertyChanged); }