OpenWithSync() public static method

public static OpenWithSync ( Realms configuration, Native syncConfiguration, RealmSchema schema, byte encryptionKey ) : SharedRealmHandle
configuration Realms
syncConfiguration Native
schema RealmSchema
encryptionKey byte
return SharedRealmHandle
コード例 #1
0
        internal override Realm CreateRealm(RealmSchema schema)
        {
            var configuration = new Realms.Native.Configuration
            {
                Path           = DatabasePath,
                schema_version = SchemaVersion
            };

            var srHandle = SharedRealmHandleExtensions.OpenWithSync(configuration, ToNative(), schema, EncryptionKey);

            return(new Realm(srHandle, this, schema));
        }
コード例 #2
0
        internal override Realm CreateRealm(RealmSchema schema)
        {
            var configuration = new Realms.Native.Configuration
            {
                schema_version = SchemaVersion
            };

            var syncConfiguration = new Native.SyncConfiguration
            {
                SyncUserHandle = User.Handle,
                Url            = ServerUri.ToString()
            };

            var srHandle = SharedRealmHandleExtensions.OpenWithSync(configuration, syncConfiguration, schema, EncryptionKey);

            return(new Realm(srHandle, this, schema));
        }
コード例 #3
0
        internal override Realm CreateRealm(RealmSchema schema)
        {
            var configuration = new Realms.Native.Configuration
            {
                Path           = DatabasePath,
                schema_version = SchemaVersion,
                enable_cache   = EnableCache
            };

            var srHandle = SharedRealmHandleExtensions.OpenWithSync(configuration, ToNative(), schema, EncryptionKey);

            if (IsDynamic && !schema.Any())
            {
                srHandle.GetSchema(nativeSchema => schema = RealmSchema.CreateFromObjectStoreSchema(nativeSchema));
            }

            return(new Realm(srHandle, this, schema));
        }
コード例 #4
0
        internal override Realm CreateRealm(RealmSchema schema)
        {
            var configuration = new Realms.Native.Configuration
            {
                Path           = DatabasePath,
                schema_version = SchemaVersion
            };

            var syncConfiguration = new Native.SyncConfiguration
            {
                SyncUserHandle      = User.Handle,
                Url                 = ServerUri.ToString(),
                client_validate_ssl = EnableSSLValidation,
            };

            var srHandle = SharedRealmHandleExtensions.OpenWithSync(configuration, syncConfiguration, schema, EncryptionKey);

            return(new Realm(srHandle, this, schema));
        }