diff --git a/CHANGELOG.md b/CHANGELOG.md
index 439fc899c8..e466779a55 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,117 @@
+v10 (TBD)
+------------------
+
+### Breaking Changes
+* We no longer support Realm Cloud (legacy), but instead the new [MongoDB Realm Cloud](https://realm.mongodb.com). MongoDB Realm is a serverless platform that enables developers to quickly build applications without having to set up server infrastructure. MongoDB Realm is built on top of MongoDB Atlas, automatically integrating the connection to your database. ([#2011](https://github.com/realm/realm-dotnet/pull/2011))
+* Remove support for Query-based sync, including the configuration parameters and the `SyncSubscription` types. ([#2011](https://github.com/realm/realm-dotnet/pull/2011))
+* Remove everything related to sync permissions, including both the path-based permission system and the object-level privileges for query-based sync. [Permissions in MongoDB Realm](https://docs.mongodb.com/realm/sync/permissions/) are defined serverside. ([#2011](https://github.com/realm/realm-dotnet/pull/2011))
+* Moved all API for dynamic access on the `Realm` class to `Realm.DynamicApi`:
+ * `Realm.CreateObject(string className, object primaryKey)` is now `Realm.DynamicApi.CreateObject(string className, object primaryKey)`.
+ * `Realm.All(string className)` is now `Realm.DynamicApi.All(string className)`.
+ * `Realm.RemoveAll(string className)` is now `Realm.DynamicApi.RemoveAll(string className)`.
+ * `Realm.Find(string className, long? primaryKey)` is now `Realm.DynamicApi.Find(string className, long? primaryKey)`.
+ * `Realm.Find(string className, string primaryKey)` is now `Realm.DynamicApi.Find(string className, string primaryKey)`.
+* It is now required that all top-level objects in a synchronized Realm have a primary key called `_id`. You can use the `MapTo("_id")` attribute to avoid using unidiomatic names for the model properties.
+* Bumped the minimum target for Xamarin.iOS apps to iOS 9.
+* Bumped the minimum API level for Xamarin.Android apps to 16 (Android 4.1).
+* Renamed `FullSyncConfiguration` to `SyncConfiguration`.
+
+### Enhancements
+* Added support for syncing to MongoDB instead of Realm Object Server. Applications must be created at [realm.mongodb.com](https://realm.mongodb.com).
+* Added an `App` class which is the entrypoint for synchronizing with a MongoDB Realm App.
+* Added `User.CustomData` containing an unstructured document with additional information about the user. Custom data is configured in your MongoDB Realm App.
+* Added `User.Functions`. This is the entry point for calling Remote MongoDB Realm functions. Functions allow you to define and execute server-side logic for your application. Functions are written in modern JavaScript (ES6+) and execute in a serverless manner. When you call a function, you can dynamically access components of the current application as well as information about the request to execute the function and the logged in user that sent the request.
+* Added `User.GetMongoClient` exposing an API for CRUD operations on a Remote MongoDB Service.
+* Added `User.GetPushClient` exposing an API for registering a device for push notifications.
+* Change `SyncConfiguration` to accept partition value instead of a server Uri. Partition values can currently be of types `string`, `long`, or `ObjectId`. Opening a realm by partition value is the equivalent of previously opening a realm by URL. In this case, partitions are meant to be more closely associated with your data. E.g., if you are a large retailer with multiple locations, the partition key can be the store Id and you each Realm will only contain data related to the specified store.
+* Add support for the Decimal128 data type. This is a 128-bit IEEE 754 decimal floating point number. Properties of this type can be declared either as `MongoDB.Bson.Decimal128` type or the built-in `decimal` type. Note that .NET's built-in decimal is 96-bit, so it cannot represent the full range of numbers, representable by `Decimal128`. (PR [#2014](https://github.com/realm/realm-dotnet/pull/2014))
+* Add support for the `ObjectId` data type. This is a 12 byte unique identifier that is common as a document id in MongoDB databases. It can be used a primary key. (PR [#2035](https://github.com/realm/realm-dotnet/pull/2035))
+* Add support for embedded objects. Embedded objects are objects which are owned by a single parent object, and are deleted when that parent object is deleted or their parent no longer references them. Embedded objects are declared by subclassing `EmbeddedObject` instead of `RealmObject`. Reassigning an embedded object is not allowed and neither is linking to it from multiple parents. Querying for embedded objects directly is also disallowed as they should be viewed as complex structures belonging to their parents as opposed to standalone objects. A trivial example is:
+
+ ```csharp
+ public class Address : EmbeddedObject
+ {
+ public string Street { get; set; }
+
+ public string City { get; set; }
+ }
+
+ public class Person : RealmObject
+ {
+ public string Name { get; set; }
+
+ // Address is an embedded object - you reference it as usual
+ public Address Address { get; set; }
+ }
+
+ public class Company : RealmObject
+ {
+ public string PhoneNumber { get; set; }
+
+ // Embedded objects can be contained in lists too
+ public IList
OfficeAddresses { get; }
+ }
+ ```
+
+* Added new dynamic methods for instantiating embedded objects:
+ * `Realm.DynamicApi.CreateEmbeddedObjectForProperty` should be used to create an embedded object and assign it to a parent's property. For example:
+
+ ```csharp
+ // static API
+ var person = new Person();
+ person.Address = new Address
+ {
+ City = "New York"
+ };
+
+ // dynamic API
+ var dynamicPerson = realm.DynamicApi.CreateObject("Person");
+ var address = realm.DynamicApi.CreateEmbeddedObjectForProperty(dynamicPerson, "Address")
+ address.City = "New York";
+ ```
+
+ * `Realm.DynamicApi.AddEmbeddedObjectToList` should be used to create an embedded object and add it to a parent's list property.
+ * `Realm.DynamicApi.InsertEmbeddedObjectInList` should be used to create an embedded object and insert it in a parent's list property at a specified index.
+ * `Realm.DynamicApi.SetEmbeddedObjectInList` should be used to create an embedded object and set it at an index in a parent's list property.
+
+ ```csharp
+ // static API
+ var company = new Company();
+ company.OfficeAddresses.Add(new Address
+ {
+ City = "New York"
+ });
+
+ company.OfficeAddresses.Insert(0, new Address
+ {
+ City = "Palo Alto"
+ });
+
+ company.OfficeAddresses[1] = new Address
+ {
+ City = "New Jersey"
+ };
+
+ // dynamic API
+ var dynamicCompany = realm.DynamicApi.CreateObject("Company");
+ var officeToAdd = realm.DynamicApi.AddEmbeddedObjectToList(dynamicCompany.OfficeAddresses);
+ officeToAdd.City = "New York";
+
+ var officeToInsert = realm.DynamicApi.InsertEmbeddedObjectInList(dynamicCompany.OfficeAddresses, 0);
+ officeToInsert.City = "Palo Alto";
+
+ var officeToSet = realm.DynamicApi.SetEmbeddedObjectInList(dynamicCompany.OfficeAddresses, 1);
+ officeToSet.City = "New Jersey";
+ ```
+
+* The memory mapping scheme for Realm files has changed to better support opening very large files.
+
+### Compatibility
+* Realm Studio: 10.0.0 or later.
+
+### Internal
+* Using Sync 10.0.0 and Core 10.0.0.
+
## 5.1.2 (TBD)
------------------
diff --git a/Jenkinsfile b/Jenkinsfile
index 58febccd7d..6839811ce5 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -23,11 +23,12 @@ stage('Checkout') {
userRemoteConfigs: scm.userRemoteConfigs
])
- if (env.BRANCH_NAME == 'master') {
- versionSuffix = "alpha-${env.BUILD_ID}"
+ // V10TODO: temporary set v10 as publishing branch
+ if (shouldPublishPackage()) {
+ versionSuffix = "alpha.${env.BUILD_ID}"
}
else if (env.CHANGE_BRANCH == null || !env.CHANGE_BRANCH.startsWith('release')) {
- versionSuffix = "PR-${env.CHANGE_ID}-${env.BUILD_ID}"
+ versionSuffix = "PR-${env.CHANGE_ID}.${env.BUILD_ID}"
}
stash includes: '**', excludes: 'wrappers/**', name: 'dotnet-source', useDefaultExcludes: false
@@ -38,7 +39,7 @@ stage('Checkout') {
stage('Build wrappers') {
def jobs = [
'iOS': {
- rlmNode('osx') {
+ rlmNode('osx || macos-catalina') {
unstash 'dotnet-wrappers-source'
dir('wrappers') {
sh "./build-ios.sh --configuration=${configuration}"
@@ -47,7 +48,7 @@ stage('Build wrappers') {
}
},
'macOS': {
- rlmNode('osx') {
+ rlmNode('osx || macos-catalina') {
unstash 'dotnet-wrappers-source'
dir('wrappers') {
sh "REALM_CMAKE_CONFIGURATION=${configuration} ./build.sh -GXcode"
@@ -59,9 +60,7 @@ stage('Build wrappers') {
rlmNode('docker') {
unstash 'dotnet-wrappers-source'
dir('wrappers') {
- buildDockerEnv("ci/realm-dotnet:wrappers", extra_args: "-f centos.Dockerfile").inside() {
- sh "REALM_CMAKE_CONFIGURATION=${configuration} ./build.sh"
- }
+ buildWrappersInDocker('wrappers', 'centos.Dockerfile', "REALM_CMAKE_CONFIGURATION=${configuration} ./build.sh")
}
stash includes: 'wrappers/build/**', name: 'linux-wrappers'
}
@@ -74,9 +73,7 @@ stage('Build wrappers') {
rlmNode('docker') {
unstash 'dotnet-wrappers-source'
dir('wrappers') {
- buildDockerEnv("ci/realm-dotnet:wrappers_android", extra_args: '-f android.Dockerfile').inside() {
- sh "./build-android.sh --configuration=${configuration} --ARCH=${localAbi}"
- }
+ buildWrappersInDocker('wrappers_android', 'android.Dockerfile', "./build-android.sh --configuration=${configuration} --ARCH=${localAbi}")
}
stash includes: 'wrappers/build/**', name: "android-wrappers-${localAbi}"
}
@@ -86,13 +83,13 @@ stage('Build wrappers') {
for(platform in WindowsPlatforms) {
def localPlatform = platform
jobs["Windows ${localPlatform}"] = {
- rlmNode('windows-vs2017') {
+ rlmNode('windows') {
unstash 'dotnet-wrappers-source'
dir('wrappers') {
powershell ".\\build.ps1 Windows -Configuration ${configuration} -Platforms ${localPlatform}"
}
stash includes: 'wrappers/build/**', name: "windows-wrappers-${localPlatform}"
- if (env.BRANCH_NAME == 'master') {
+ if (shouldPublishPackage()) {
archiveArtifacts 'wrappers/build/**/*.pdb'
}
}
@@ -102,13 +99,13 @@ stage('Build wrappers') {
for(platform in WindowsUniversalPlatforms) {
def localPlatform = platform
jobs["WindowsUniversal ${localPlatform}"] = {
- rlmNode('windows-vs2017') {
+ rlmNode('windows') {
unstash 'dotnet-wrappers-source'
dir('wrappers') {
powershell ".\\build.ps1 WindowsStore -Configuration ${configuration} -Platforms ${localPlatform}"
}
stash includes: 'wrappers/build/**', name: "windowsuniversal-wrappers-${localPlatform}"
- if (env.BRANCH_NAME == 'master') {
+ if (shouldPublishPackage()) {
archiveArtifacts 'wrappers/build/**/*.pdb'
}
}
@@ -164,7 +161,7 @@ stage('Package') {
packageVersion = getVersion(packages[0].name);
echo "Inferred version is ${packageVersion}"
- if (env.BRANCH_NAME == 'master') {
+ if (shouldPublishPackage()) {
withCredentials([usernamePassword(credentialsId: 'github-packages-token', usernameVariable: 'GITHUB_USERNAME', passwordVariable: 'GITHUB_PASSWORD')]) {
echo "Publishing Realm.Fody.${packageVersion} to github packages"
bat "dotnet nuget add source https://nuget.pkg.github.com/realm/index.json -n github -u ${env.GITHUB_USERNAME} -p ${env.GITHUB_PASSWORD} & exit 0"
@@ -329,13 +326,18 @@ def NetCoreTest(String nodeName) {
dotnet build -c ${configuration} -f netcoreapp20 -p:RestoreConfigFile=${env.WORKSPACE}/Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${packageVersion}
dotnet run -c ${configuration} -f netcoreapp20 --no-build -- --labels=After --result=${env.WORKSPACE}/TestResults.NetCore.xml
""".trim()
+
+ String appLocation = "${env.WORKSPACE}/Tests/TestApps/dotnet-integration-tests"
+
if (isUnix()) {
if (nodeName == 'docker') {
def test_runner_image = docker.image('mcr.microsoft.com/dotnet/core/sdk:2.1')
test_runner_image.pull()
- withRos('3.23.1') { ros ->
- test_runner_image.inside("--link ${ros.id}:ros") {
- script += ' --ros $ROS_PORT_9080_TCP_ADDR --rosport $ROS_PORT_9080_TCP_PORT'
+ withRealmCloud(version: '2020-10-12', appsToImport: ["dotnet-integration-tests": appLocation]) { networkName ->
+ test_runner_image.inside("--network=${networkName}") {
+ def appId = sh script: "cat ${appLocation}/app_id", returnStdout: true
+
+ script += " --baasurl http://mongodb-realm:9090 --baasappid ${appId.trim()}"
// see https://stackoverflow.com/a/53782505
sh """
export HOME=/tmp
@@ -401,6 +403,19 @@ def reportTests(spec) {
)
}
+def buildWrappersInDocker(String label, String image, String invocation) {
+ String uid = sh(script: 'id -u', returnStdout: true).trim()
+ String gid = sh(script: 'id -g', returnStdout: true).trim()
+
+ buildDockerEnv("ci/realm-dotnet:${label}", extra_args: "-f ${image}").inside("--mount 'type=bind,src=/tmp,dst=/tmp' -u ${uid}:${gid}") {
+ sh invocation
+ }
+}
+
+boolean shouldPublishPackage() {
+ return env.BRANCH_NAME == 'master' || (env.CHANGE_BRANCH != null && env.CHANGE_BRANCH == 'v10')
+}
+
// Required due to JENKINS-27421
@NonCPS
List> mapToList(Map map) {
diff --git a/Manual Tests/NuGetReleaseTests/NuGetReleaseTests.sln b/Manual Tests/NuGetReleaseTests/NuGetReleaseTests.sln
deleted file mode 100644
index 4b37238807..0000000000
--- a/Manual Tests/NuGetReleaseTests/NuGetReleaseTests.sln
+++ /dev/null
@@ -1,260 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26730.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Tests.Shared", "..\..\Tests\Tests.Shared\Tests.Shared.shproj", "{06146619-D21C-414C-BFE3-2F59ACBA412E}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Tests.Sync.Shared", "..\..\Tests\Tests.Sync.Shared\Tests.Sync.Shared.shproj", "{C81983E0-58A0-4D67-B0D0-AE91ABA71A2C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Android", "Tests.Android\Tests.Android.csproj", "{AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.iOS", "Tests.iOS\Tests.iOS.csproj", "{D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.UWP", "Tests.UWP\Tests.UWP.csproj", "{159A55AF-9531-4107-8444-CA9C96107EF5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Win32", "Tests.Win32\Tests.Win32.csproj", "{BFC1C1B7-2864-4456-9DEC-309A3F006B66}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.NetCore", "Tests.NetCore\Tests.NetCore.csproj", "{1F426652-FDA6-49AF-B621-7C8B9189B1BD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.XamarinMac", "Tests.XamarinMac\Tests.XamarinMac.csproj", "{3A6CC342-40D0-4487-9964-DDAEBA628199}"
-EndProject
-Global
- GlobalSection(SharedMSBuildProjectFiles) = preSolution
- ..\..\Tests\Tests.Shared\Tests.Shared.projitems*{06146619-d21c-414c-bfe3-2f59acba412e}*SharedItemsImports = 13
- ..\..\Tests\Tests.Shared\Tests.Shared.projitems*{159a55af-9531-4107-8444-ca9c96107ef5}*SharedItemsImports = 4
- ..\..\Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{159a55af-9531-4107-8444-ca9c96107ef5}*SharedItemsImports = 4
- ..\..\Tests\Tests.Shared\Tests.Shared.projitems*{bfc1c1b7-2864-4456-9dec-309a3f006b66}*SharedItemsImports = 4
- ..\..\Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{bfc1c1b7-2864-4456-9dec-309a3f006b66}*SharedItemsImports = 4
- ..\..\Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{c81983e0-58a0-4d67-b0d0-ae91aba71a2c}*SharedItemsImports = 13
- EndGlobalSection
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|ARM = Debug|ARM
- Debug|iPhone = Debug|iPhone
- Debug|iPhoneSimulator = Debug|iPhoneSimulator
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- NativeDebug|Any CPU = NativeDebug|Any CPU
- NativeDebug|ARM = NativeDebug|ARM
- NativeDebug|iPhone = NativeDebug|iPhone
- NativeDebug|iPhoneSimulator = NativeDebug|iPhoneSimulator
- NativeDebug|x64 = NativeDebug|x64
- NativeDebug|x86 = NativeDebug|x86
- Release|Any CPU = Release|Any CPU
- Release|ARM = Release|ARM
- Release|iPhone = Release|iPhone
- Release|iPhoneSimulator = Release|iPhoneSimulator
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|ARM.Build.0 = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|iPhone.Build.0 = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|x64.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Debug|x86.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.NativeDebug|ARM.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.NativeDebug|iPhone.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.NativeDebug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.NativeDebug|x64.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.NativeDebug|x86.ActiveCfg = Debug|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|Any CPU.Build.0 = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|ARM.ActiveCfg = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|ARM.Build.0 = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|iPhone.ActiveCfg = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|iPhone.Build.0 = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|x64.ActiveCfg = Release|Any CPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}.Release|x86.ActiveCfg = Release|Any CPU
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|ARM.Build.0 = Debug|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|iPhone.ActiveCfg = Debug|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|iPhone.Build.0 = Debug|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|x64.ActiveCfg = Debug|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Debug|x86.ActiveCfg = Debug|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.NativeDebug|Any CPU.ActiveCfg = Release|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.NativeDebug|ARM.ActiveCfg = Release|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.NativeDebug|iPhone.ActiveCfg = Debug|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.NativeDebug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.NativeDebug|x64.ActiveCfg = Release|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.NativeDebug|x86.ActiveCfg = Release|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|ARM.ActiveCfg = Release|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|ARM.Build.0 = Release|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|iPhone.ActiveCfg = Release|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|iPhone.Build.0 = Release|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|x64.ActiveCfg = Release|iPhone
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}.Release|x86.ActiveCfg = Release|iPhone
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|Any CPU.ActiveCfg = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|ARM.ActiveCfg = Debug|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|ARM.Build.0 = Debug|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|ARM.Deploy.0 = Debug|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|iPhone.ActiveCfg = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x64.ActiveCfg = Debug|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x64.Build.0 = Debug|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x64.Deploy.0 = Debug|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x86.ActiveCfg = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x86.Build.0 = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x86.Deploy.0 = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|Any CPU.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|Any CPU.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|Any CPU.Deploy.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|ARM.ActiveCfg = Debug|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|ARM.Build.0 = Debug|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|ARM.Deploy.0 = Debug|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|iPhone.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|iPhone.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|iPhone.Deploy.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|iPhoneSimulator.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|iPhoneSimulator.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|iPhoneSimulator.Deploy.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|x64.ActiveCfg = Debug|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|x64.Build.0 = Debug|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|x64.Deploy.0 = Debug|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|x86.ActiveCfg = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|x86.Build.0 = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.NativeDebug|x86.Deploy.0 = Debug|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|Any CPU.ActiveCfg = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|ARM.ActiveCfg = Release|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|ARM.Build.0 = Release|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|ARM.Deploy.0 = Release|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|iPhone.ActiveCfg = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|iPhoneSimulator.ActiveCfg = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x64.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x64.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x64.Deploy.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x86.ActiveCfg = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x86.Build.0 = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x86.Deploy.0 = Release|x86
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|ARM.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|iPhone.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|x64.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|x64.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|x86.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Debug|x86.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|ARM.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|ARM.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|iPhone.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|iPhone.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|x64.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|x64.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|x86.ActiveCfg = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.NativeDebug|x86.Build.0 = Debug|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|Any CPU.Build.0 = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|ARM.ActiveCfg = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|ARM.Build.0 = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|iPhone.ActiveCfg = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|iPhone.Build.0 = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|x64.ActiveCfg = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|x64.Build.0 = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|x86.ActiveCfg = Release|Any CPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}.Release|x86.Build.0 = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|ARM.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|iPhone.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|x64.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Debug|x86.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|ARM.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|ARM.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|iPhone.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|iPhone.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|x64.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|x64.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|x86.ActiveCfg = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.NativeDebug|x86.Build.0 = Debug|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|Any CPU.Build.0 = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|ARM.ActiveCfg = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|ARM.Build.0 = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|iPhone.ActiveCfg = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|iPhone.Build.0 = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|x64.ActiveCfg = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|x64.Build.0 = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|x86.ActiveCfg = Release|Any CPU
- {1F426652-FDA6-49AF-B621-7C8B9189B1BD}.Release|x86.Build.0 = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|ARM.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhone.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x64.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x64.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x86.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x86.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|ARM.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|ARM.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|iPhone.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|iPhone.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|x64.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|x64.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|x86.ActiveCfg = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.NativeDebug|x86.Build.0 = Debug|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|Any CPU.Build.0 = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|ARM.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|ARM.Build.0 = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhone.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhone.Build.0 = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x64.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x64.Build.0 = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x86.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x86.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {9F2E1B1D-81A3-473E-8633-86CF2EE2BBE5}
- EndGlobalSection
-EndGlobal
diff --git a/Manual Tests/NuGetReleaseTests/README.md b/Manual Tests/NuGetReleaseTests/README.md
deleted file mode 100644
index cceafea78c..0000000000
--- a/Manual Tests/NuGetReleaseTests/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-NuGetReleaseTests
-=============
-
-The separate solution `NuGetReleaseTests.sln` reuses our shared test code normally run
-within the main `Realm.sln` but pulls in Realm via our NuGet packages.
-
-This means we can easily run the unit test suite again over the release version of the PCL
-to ensure no problems would present themselves to users which got past other builds of tests.
-
-Note as a side-effect of using NuGet to add Realm, it adds the`Realm.PCL` project to the solution, even though we're not using a PCL anywhere.
-
-Using this Solution
--------------------
-The solution as bundled in our source repo does **not** include Realm.
-
-You should:
-1. Duplicate the entire folder `NuGetReleaseTests`
-2. In the duplicated `NuGetReleaseTests.sln` use NuGet to add the Realm package to both the IOS and Android projects.
-3. Build.
-
-This ensures we replicate the experience of starting out with NuGet to add packages.
-
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Constants.cs b/Manual Tests/NuGetReleaseTests/Tests.Android/Constants.cs
deleted file mode 100644
index e9a4702e7b..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Android/Constants.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-namespace Tests
-{
- public static class Constants
- {
- public const string ActivityLabel = "NuGet Tests";
- public const string PackageName = "io.realm.nugettests";
- }
-}
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/FodyWeavers.xml b/Manual Tests/NuGetReleaseTests/Tests.Android/FodyWeavers.xml
deleted file mode 100644
index 6aa124364c..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Android/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Properties/AndroidManifest.xml b/Manual Tests/NuGetReleaseTests/Tests.Android/Properties/AndroidManifest.xml
deleted file mode 100644
index a54625988e..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Android/Properties/AndroidManifest.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-hdpi/Icon.png b/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-hdpi/Icon.png
deleted file mode 100644
index 055d8ac77e..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-hdpi/Icon.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-ldpi/icon.png b/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-ldpi/icon.png
deleted file mode 100644
index 8be15a63dd..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-ldpi/icon.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-mdpi/Icon.png b/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-mdpi/Icon.png
deleted file mode 100644
index 5ef8d4ca1a..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-mdpi/Icon.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xhdpi/Icon.png b/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xhdpi/Icon.png
deleted file mode 100644
index 7f3ebbeadb..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xhdpi/Icon.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xxhdpi/Icon.png b/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xxhdpi/Icon.png
deleted file mode 100644
index 91cb35f5df..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xxhdpi/Icon.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xxxhdpi/Icon.png b/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xxxhdpi/Icon.png
deleted file mode 100644
index 8a3194cd94..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.Android/Resources/drawable-xxxhdpi/Icon.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Settings.StyleCop b/Manual Tests/NuGetReleaseTests/Tests.Android/Settings.StyleCop
deleted file mode 100644
index 805dec909e..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Android/Settings.StyleCop
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/Tests.Android.csproj b/Manual Tests/NuGetReleaseTests/Tests.Android/Tests.Android.csproj
deleted file mode 100644
index 9575b04c0f..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Android/Tests.Android.csproj
+++ /dev/null
@@ -1,218 +0,0 @@
-
-
-
-
-
-
- Debug
- AnyCPU
- {AD7B78B0-AE51-4FB7-9B11-4E22A2B538CA}
- {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Properties
- Tests
- Tests.Android
- 512
- true
- Resources\Resource.Designer.cs
- Off
- Properties\AndroidManifest.xml
- True
- armeabi,armeabi-v7a,x86
-
-
-
-
-
-
-
- True
- v8.1
- Full
- false
- nunit.runner.Droid
-
-
- true
- full
- false
- bin\Debug\
- bin\Debug\
- DEBUG;TRACE;ROS_SETUP
- prompt
- 4
- false
- armeabi-v7a;x86;arm64-v8a;x86_64
-
-
-
- true
- bin\Release\
- TRACE;ROS_SETUP
- prompt
- 4
- False
- armeabi;armeabi-v7a;x86
-
-
-
-
-
- ..\packages\NUnit.3.6.1\lib\MonoAndroid\nunit.framework.dll
-
-
- ..\packages\PCLStorage.1.0.2\lib\monoandroid\PCLStorage.dll
-
-
- ..\packages\PCLStorage.1.0.2\lib\monoandroid\PCLStorage.Abstractions.dll
-
-
-
-
-
-
- ..\..\..\dependencies\nunit.xamarin.3.6.1\MonoAndroid\nunit.runner.Droid.dll
-
-
-
-
-
- ..\packages\System.Runtime.Loader.4.0.0\lib\netstandard1.5\System.Runtime.Loader.dll
-
-
- ..\packages\Nito.Disposables.1.0.0\lib\portable45-net45+win8+wp8+wpa81\Nito.Disposables.dll
-
-
- ..\packages\Nito.AsyncEx.Tasks.1.1.0\lib\netstandard1.3\Nito.AsyncEx.Tasks.dll
-
-
- ..\packages\Nito.AsyncEx.Context.1.1.0\lib\netstandard1.3\Nito.AsyncEx.Context.dll
-
-
- ..\packages\System.Reactive.Interfaces.3.1.1\lib\netstandard1.0\System.Reactive.Interfaces.dll
-
-
- ..\packages\System.Reactive.Core.3.1.1\lib\netstandard1.3\System.Reactive.Core.dll
-
-
- ..\packages\System.Reactive.Linq.3.1.1\lib\netstandard1.3\System.Reactive.Linq.dll
-
-
- ..\packages\System.Reactive.PlatformServices.3.1.1\lib\netstandard1.3\System.Reactive.PlatformServices.dll
-
-
- ..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
-
-
- ..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll
-
-
- ..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll
-
-
- ..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll
-
-
- ..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll
-
-
- ..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
-
-
- ..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll
-
-
- ..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\MonoAndroid10\FormsViewGroup.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\MonoAndroid10\Xamarin.Forms.Core.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
-
-
- ..\packages\Realm.DataBinding.1.2.0\lib\MonoAndroid44\Realm.DataBinding.dll
-
-
- ..\packages\Remotion.Linq.2.1.2\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll
-
-
- ..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\packages\Realm.Database.3.0.0\lib\netstandard1.4\Realm.dll
-
-
- ..\packages\Realm.3.0.0\lib\netstandard1.4\Realm.Sync.dll
-
-
-
-
-
-
- MainActivity.cs
-
-
- TestRunnerInstrumentation.cs
-
-
-
-
-
- app.config
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Assets\ForMigrationsToCopyAndMigrate.realm
-
-
- Assets\nunit3-junit.xslt
-
-
- Assets\trusted_ca.pem
-
-
- Assets\sync-1.x-encrypted.realm
-
-
- Assets\sync-1.x.realm
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Android/packages.config b/Manual Tests/NuGetReleaseTests/Tests.Android/packages.config
deleted file mode 100644
index a157b13017..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Android/packages.config
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.NetCore/FodyWeavers.xml b/Manual Tests/NuGetReleaseTests/Tests.NetCore/FodyWeavers.xml
deleted file mode 100644
index e071208def..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.NetCore/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.NetCore/Tests.NetCore.csproj b/Manual Tests/NuGetReleaseTests/Tests.NetCore/Tests.NetCore.csproj
deleted file mode 100644
index c78be296ac..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.NetCore/Tests.NetCore.csproj
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
- netcoreapp1.1
- Exe
- win-x64;osx-x64;debian.8-x64;ubuntu.16.04-x64
-
-
-
- TRACE;DEBUG;NETCOREAPP1_1;ROS_SETUP
-
-
-
- TRACE;RELEASE;NETCOREAPP1_1;ROS_SETUP
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ForMigrationsToCopyAndMigrate.realm
- PreserveNewest
-
-
- PreserveNewest
-
-
- trusted_ca.pem
- PreserveNewest
-
-
- sync-1.x-encrypted.realm
- PreserveNewest
-
-
- sync-1.x.realm
- PreserveNewest
-
-
-
-
-
- Program.cs
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/Logo.scale-100.png b/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/Logo.scale-100.png
deleted file mode 100644
index da35ed02cc..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/Logo.scale-100.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/MediumTile.scale-100.png b/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/MediumTile.scale-100.png
deleted file mode 100644
index b3642f9f8e..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/MediumTile.scale-100.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/SmallTile.scale-100.png b/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/SmallTile.scale-100.png
deleted file mode 100644
index f6843af449..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/SmallTile.scale-100.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/StoreLogo.scale-100.png b/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/StoreLogo.scale-100.png
deleted file mode 100644
index 16e77bfdfb..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.UWP/Assets/StoreLogo.scale-100.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/FodyWeavers.xml b/Manual Tests/NuGetReleaseTests/Tests.UWP/FodyWeavers.xml
deleted file mode 100644
index eb982b3e95..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.UWP/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Package.appxmanifest b/Manual Tests/NuGetReleaseTests/Tests.UWP/Package.appxmanifest
deleted file mode 100644
index 28c482f309..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.UWP/Package.appxmanifest
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
- io.realm.nugettests
- Realm
- Assets\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Properties/Default.rd.xml b/Manual Tests/NuGetReleaseTests/Tests.UWP/Properties/Default.rd.xml
deleted file mode 100644
index d325c1481b..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.UWP/Properties/Default.rd.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Tests.UWP.csproj b/Manual Tests/NuGetReleaseTests/Tests.UWP/Tests.UWP.csproj
deleted file mode 100644
index d6cde9825f..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.UWP/Tests.UWP.csproj
+++ /dev/null
@@ -1,184 +0,0 @@
-
-
-
-
- Debug
- x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}
- AppContainerExe
- Properties
- Tests
- Tests.UWP
- en-US
- UAP
- 10.0.15063.0
- 10.0.10586.0
- 14
- 512
- {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- true
- Tests.UWP_TemporaryKey.pfx
- NETFX_CORE;WINDOWS;WINDOWS_UWP;CODE_ANALYSIS;ENCRYPTION_DISABLED
- F3B7F911B519898CE28977B59583CE74514C212C
-
-
- true
- bin\x86\Debug\
- TRACE;DEBUG;$(DefineConstants)
- ;2008
- full
- x86
- false
- prompt
- true
-
-
- bin\x86\Release\
- TRACE;$(DefineConstants)
- true
- ;2008
- pdbonly
- x86
- false
- prompt
- true
- true
-
-
- true
- bin\ARM\Debug\
- TRACE;DEBUG;$(DefineConstants)
- ;2008
- full
- ARM
- false
- prompt
- true
-
-
- bin\ARM\Release\
- TRACE;$(DefineConstants)
- true
- ;2008
- pdbonly
- ARM
- false
- prompt
- true
- true
-
-
- true
- bin\x64\Debug\
- TRACE;DEBUG;NETFX_CORE;WINDOWS;WINDOWS_UWP;CODE_ANALYSIS;ENCRYPTION_DISABLED;CODE_ANALYSIS;ROS_SETUP
- ;2008
- full
- x64
- false
- prompt
- true
-
-
- bin\x64\Release\
- TRACE;NETFX_CORE;WINDOWS;WINDOWS_UWP;CODE_ANALYSIS;ENCRYPTION_DISABLED;CODE_ANALYSIS;ROS_SETUP
- true
- ;2008
- pdbonly
- x64
- false
- prompt
- true
- true
-
-
- PackageReference
-
-
-
- Designer
-
-
- sync-1.x-encrypted.realm
- PreserveNewest
-
-
- sync-1.x.realm
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
- ucrtbased.dll
-
-
- ForMigrationsToCopyAndMigrate.realm
- PreserveNewest
-
-
-
-
- 6.0.6
-
-
- 1.1.0
-
-
- 3.9.0
-
-
- 1.0.2
-
-
- 3.0.0
-
-
- 4.3.0
-
-
- 3.1.1
-
-
- 2.3.4.231
-
-
-
-
- ..\..\..\dependencies\nunit.xamarin.3.6.1\uap10.0\nunit.runner.uwp.dll
-
-
-
-
- App.xaml
- MSBuild:Compile
- Designer
-
-
- MainPage.xaml
- MSBuild:Compile
- Designer
-
-
-
-
- App.xaml
- App.xaml.cs
-
-
- MainPage.xaml
- MainPage.xaml.cs
-
-
-
-
-
- 14.0
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.UWP/Tests.UWP_TemporaryKey.pfx b/Manual Tests/NuGetReleaseTests/Tests.UWP/Tests.UWP_TemporaryKey.pfx
deleted file mode 100644
index 32b83e1bc4..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.UWP/Tests.UWP_TemporaryKey.pfx and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Win32/FodyWeavers.xml b/Manual Tests/NuGetReleaseTests/Tests.Win32/FodyWeavers.xml
deleted file mode 100644
index af39d80202..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Win32/FodyWeavers.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Win32/Settings.StyleCop b/Manual Tests/NuGetReleaseTests/Tests.Win32/Settings.StyleCop
deleted file mode 100644
index 805dec909e..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Win32/Settings.StyleCop
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Win32/Tests.Win32.csproj b/Manual Tests/NuGetReleaseTests/Tests.Win32/Tests.Win32.csproj
deleted file mode 100644
index bab9fdb4e4..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Win32/Tests.Win32.csproj
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
-
-
-
- Debug
- AnyCPU
- {BFC1C1B7-2864-4456-9DEC-309A3F006B66}
- Library
- Properties
- Tests.Win32
- Tests.Win32
- v4.6.2
- 512
- false
-
-
-
-
-
- true
- full
- false
- bin\Debug\
- TRACE;DEBUG;WINDOWS;ENCRYPTION_DISABLED;ROS_SETUP
- prompt
- 4
- MinimumRecommendedRules.ruleset
-
-
- pdbonly
- true
- bin\Release\
- TRACE;WINDOWS;ENCRYPTION_DISABLED;ROS_SETUP
- prompt
- 4
- AllRules.ruleset
-
-
-
- ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
-
-
- ..\packages\Nito.AsyncEx.Context.1.1.0\lib\net46\Nito.AsyncEx.Context.dll
-
-
- ..\packages\Nito.AsyncEx.Tasks.1.1.0\lib\net46\Nito.AsyncEx.Tasks.dll
-
-
- ..\packages\Nito.Disposables.1.0.0\lib\portable45-net45+win8+wp8+wpa81\Nito.Disposables.dll
-
-
- ..\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll
-
-
- ..\packages\Realm.Database.3.0.0\lib\netstandard1.4\Realm.dll
-
-
- ..\packages\Realm.DataBinding.1.2.0\lib\netstandard1.0\Realm.DataBinding.dll
-
-
- ..\packages\Realm.3.0.0\lib\netstandard1.4\Realm.Sync.dll
-
-
- ..\packages\Remotion.Linq.2.1.2\lib\net45\Remotion.Linq.dll
-
-
-
- ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll
-
-
-
- ..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll
-
-
-
- ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll
-
-
- ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll
-
-
- ..\packages\System.Net.Http.4.3.1\lib\net46\System.Net.Http.dll
-
-
-
- ..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll
-
-
- ..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll
-
-
- ..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll
-
-
- ..\packages\System.Reactive.PlatformServices.3.1.1\lib\net46\System.Reactive.PlatformServices.dll
-
-
- ..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll
-
-
- ..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll
-
-
- ..\packages\System.Reflection.TypeExtensions.4.3.0\lib\net462\System.Reflection.TypeExtensions.dll
-
-
- ..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll
-
-
- ..\packages\System.Runtime.InteropServices.4.3.0\lib\net462\System.Runtime.InteropServices.dll
-
-
- ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
-
-
- ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll
-
-
- ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll
-
-
- ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll
-
-
- ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll
-
-
-
-
-
-
-
-
-
-
-
-
- sync-1.x-encrypted.realm
- PreserveNewest
-
-
- sync-1.x.realm
- PreserveNewest
-
-
-
- ForMigrationsToCopyAndMigrate.realm
- PreserveNewest
-
-
-
-
- nunit3-junit.xslt
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Win32/app.config b/Manual Tests/NuGetReleaseTests/Tests.Win32/app.config
deleted file mode 100644
index 97a7db934f..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Win32/app.config
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.Win32/packages.config b/Manual Tests/NuGetReleaseTests/Tests.Win32/packages.config
deleted file mode 100644
index 496f9b38b2..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.Win32/packages.config
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/Contents.json b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index e550a07eb4..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,214 +0,0 @@
-{
- "images": [
- {
- "size": "29x29",
- "scale": "1x",
- "idiom": "iphone"
- },
- {
- "size": "29x29",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "size": "29x29",
- "scale": "3x",
- "idiom": "iphone"
- },
- {
- "size": "40x40",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "size": "40x40",
- "scale": "3x",
- "idiom": "iphone"
- },
- {
- "size": "57x57",
- "scale": "1x",
- "idiom": "iphone"
- },
- {
- "size": "57x57",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "size": "60x60",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "size": "60x60",
- "scale": "3x",
- "idiom": "iphone"
- },
- {
- "size": "29x29",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "29x29",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "40x40",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "40x40",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "50x50",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "50x50",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "83.5x83.5",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "72x72",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "72x72",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "76x76",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "76x76",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "role": "notificationCenter",
- "size": "24x24",
- "subtype": "38mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "notificationCenter",
- "size": "27.5x27.5",
- "subtype": "42mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "companionSettings",
- "size": "29x29",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "companionSettings",
- "size": "29x29",
- "scale": "3x",
- "idiom": "watch"
- },
- {
- "role": "appLauncher",
- "size": "40x40",
- "subtype": "38mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "longLook",
- "size": "44x44",
- "subtype": "42mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "quickLook",
- "size": "86x86",
- "subtype": "38mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "quickLook",
- "size": "98x98",
- "subtype": "42mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "size": "16x16",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "16x16",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "size": "32x32",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "32x32",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "filename": "RealmGenericFilled-128.png",
- "size": "128x128",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "filename": "RealmGenericFilled-256.png",
- "size": "128x128",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "size": "256x256",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "256x256",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "size": "512x512",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "512x512",
- "scale": "2x",
- "idiom": "mac"
- }
- ],
- "info": {
- "version": 1,
- "author": "xcode"
- }
-}
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-128.png b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-128.png
deleted file mode 100644
index c85ba55f63..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-128.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-256.png b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-256.png
deleted file mode 100644
index 8dd3df0850..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-256.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/Contents.json b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/Contents.json
deleted file mode 100644
index 4caf392f92..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Assets.xcassets/Contents.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/FodyWeavers.xml b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/FodyWeavers.xml
deleted file mode 100644
index 6aa124364c..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Info.plist b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Info.plist
deleted file mode 100644
index a28f7fda32..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Info.plist
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
- CFBundleIdentifier
- io.realm.xamarinmactests
- CFBundleShortVersionString
- 1.0
- CFBundleVersion
- 1
- LSMinimumSystemVersion
- 10.12
- CFBundleDevelopmentRegion
- en
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundlePackageType
- APPL
- CFBundleSignature
- ????
- NSHumanReadableCopyright
- (c) Nikola Irinchev
- NSPrincipalClass
- NSApplication
- NSMainStoryboardFile
- Main
- XSAppIconAssets
- Assets.xcassets/AppIcon.appiconset
- CFBundleName
- Realm Tests
- NSAppTransportSecurity
-
- NSAllowsArbitraryLoads
-
-
-
-
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Tests.XamarinMac.csproj b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Tests.XamarinMac.csproj
deleted file mode 100644
index d79370b699..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/Tests.XamarinMac.csproj
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}
- {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Exe
- Tests.XamarinMac
- Tests.XamarinMac
- v2.0
- Xamarin.Mac
- Resources
-
-
- true
- full
- false
- bin\Debug
- __UNIFIED__;__MACOS__;DEBUG;ROS_SETUP
- prompt
- 4
- false
- Mac Developer
- false
- false
- false
- true
- true
- NSUrlSessionHandler
- None
-
- None
-
-
-
- true
- bin\Release
- __UNIFIED__;__MACOS__;ROS_SETUP
- prompt
- 4
- false
- false
- false
- true
- true
- true
- None
- NSUrlSessionHandler
-
- None
-
-
- --labels=On
-
-
-
-
-
-
-
-
- ..\packages\Nito.Disposables.1.0.0\lib\netstandard1.0\Nito.Disposables.dll
-
-
- ..\packages\Nito.AsyncEx.Tasks.1.1.0\lib\netstandard1.3\Nito.AsyncEx.Tasks.dll
-
-
- ..\packages\Nito.AsyncEx.Context.1.1.0\lib\netstandard1.3\Nito.AsyncEx.Context.dll
-
-
- ..\packages\Remotion.Linq.2.1.2\lib\netstandard1.0\Remotion.Linq.dll
-
-
-
- ..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
-
-
- ..\packages\System.Runtime.InteropServices.WindowsRuntime.4.0.1\lib\netstandard1.3\System.Runtime.InteropServices.WindowsRuntime.dll
-
-
- ..\packages\System.Reactive.Interfaces.3.1.1\lib\netstandard1.0\System.Reactive.Interfaces.dll
-
-
- ..\packages\System.Reactive.Core.3.1.1\lib\netstandard1.3\System.Reactive.Core.dll
-
-
- ..\packages\System.Reactive.Linq.3.1.1\lib\netstandard1.3\System.Reactive.Linq.dll
-
-
- ..\packages\System.Reactive.PlatformServices.3.1.1\lib\netstandard1.3\System.Reactive.PlatformServices.dll
-
-
- ..\packages\NUnit.3.6.1\lib\netstandard1.6\nunit.framework.dll
-
-
- ..\packages\NUnitLite.3.7.1\lib\netstandard1.6\nunitlite.dll
-
-
- ..\packages\Realm.DataBinding.1.2.0\lib\Xamarin.Mac20\Realm.DataBinding.dll
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\packages\Realm.Database.3.0.0\lib\netstandard1.4\Realm.dll
-
-
- ..\packages\Realm.3.0.0\lib\netstandard1.4\Realm.Sync.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AppDelegate.cs
-
-
- Main.cs
-
-
- ViewController.cs
-
-
- ViewController.designer.cs
- ViewController.cs
-
-
-
-
- Resources\ForMigrationsToCopyAndMigrate.realm
- PreserveNewest
-
-
- Resources\nunit3-junit.xslt
- PreserveNewest
-
-
- Resources\trusted_ca.pem
-
-
- Resources\sync-1.x-encrypted.realm
- PreserveNewest
-
-
- Resources\sync-1.x.realm
- PreserveNewest
-
-
-
-
- Main.storyboard
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/packages.config b/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/packages.config
deleted file mode 100644
index 9a25032a46..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.XamarinMac/packages.config
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index 86b63ece7b..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,214 +0,0 @@
-{
- "images": [
- {
- "size": "29x29",
- "scale": "1x",
- "idiom": "iphone"
- },
- {
- "size": "29x29",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "size": "29x29",
- "scale": "3x",
- "idiom": "iphone"
- },
- {
- "size": "40x40",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "size": "40x40",
- "scale": "3x",
- "idiom": "iphone"
- },
- {
- "size": "57x57",
- "scale": "1x",
- "idiom": "iphone"
- },
- {
- "size": "57x57",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "filename": "RealmGenericFilled-60@2x.png",
- "size": "60x60",
- "scale": "2x",
- "idiom": "iphone"
- },
- {
- "filename": "RealmGenericFilled-60@3x.png",
- "size": "60x60",
- "scale": "3x",
- "idiom": "iphone"
- },
- {
- "size": "29x29",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "29x29",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "40x40",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "40x40",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "50x50",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "50x50",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "83.5x83.5",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "72x72",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "72x72",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "size": "76x76",
- "scale": "1x",
- "idiom": "ipad"
- },
- {
- "size": "76x76",
- "scale": "2x",
- "idiom": "ipad"
- },
- {
- "role": "notificationCenter",
- "size": "24x24",
- "subtype": "38mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "notificationCenter",
- "size": "27.5x27.5",
- "subtype": "42mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "companionSettings",
- "size": "29x29",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "companionSettings",
- "size": "29x29",
- "scale": "3x",
- "idiom": "watch"
- },
- {
- "role": "appLauncher",
- "size": "40x40",
- "subtype": "38mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "longLook",
- "size": "44x44",
- "subtype": "42mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "quickLook",
- "size": "86x86",
- "subtype": "38mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "role": "quickLook",
- "size": "98x98",
- "subtype": "42mm",
- "scale": "2x",
- "idiom": "watch"
- },
- {
- "size": "16x16",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "16x16",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "size": "32x32",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "32x32",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "size": "128x128",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "128x128",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "size": "256x256",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "256x256",
- "scale": "2x",
- "idiom": "mac"
- },
- {
- "size": "512x512",
- "scale": "1x",
- "idiom": "mac"
- },
- {
- "size": "512x512",
- "scale": "2x",
- "idiom": "mac"
- }
- ],
- "info": {
- "version": 1,
- "author": "xcode"
- }
-}
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-60@2x.png b/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-60@2x.png
deleted file mode 100644
index 1cd2695f07..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-60@2x.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-60@3x.png b/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-60@3x.png
deleted file mode 100644
index a619e89fc1..0000000000
Binary files a/Manual Tests/NuGetReleaseTests/Tests.iOS/Assets.xcassets/AppIcon.appiconset/RealmGenericFilled-60@3x.png and /dev/null differ
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/FodyWeavers.xml b/Manual Tests/NuGetReleaseTests/Tests.iOS/FodyWeavers.xml
deleted file mode 100644
index 6aa124364c..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.iOS/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/Info.plist b/Manual Tests/NuGetReleaseTests/Tests.iOS/Info.plist
deleted file mode 100644
index 8eba9eeb4f..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.iOS/Info.plist
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
- UIDeviceFamily
-
- 1
- 2
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- MinimumOSVersion
- 7.1
- CFBundleIdentifier
- io.realm.nugettests
- CFBundleVersion
- 1.0
- UILaunchStoryboardName
- LaunchScreen
- CFBundleShortVersionString
- 1.0
- XSAppIconAssets
- Assets.xcassets/AppIcon.appiconset
- CFBundleName
- NuGet Tests
-
-
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/Resources/LaunchScreen.storyboard b/Manual Tests/NuGetReleaseTests/Tests.iOS/Resources/LaunchScreen.storyboard
deleted file mode 100644
index c42b3b4720..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.iOS/Resources/LaunchScreen.storyboard
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/Settings.StyleCop b/Manual Tests/NuGetReleaseTests/Tests.iOS/Settings.StyleCop
deleted file mode 100644
index 805dec909e..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.iOS/Settings.StyleCop
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/Tests.iOS.csproj b/Manual Tests/NuGetReleaseTests/Tests.iOS/Tests.iOS.csproj
deleted file mode 100644
index 6512de0259..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.iOS/Tests.iOS.csproj
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
- Debug
- iPhoneSimulator
- {D2CED8F0-7A76-454D-B5F7-9E8B9FE6A58E}
- {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Exe
- Tests
- Resources
- Tests.iOS
- false
-
-
-
- true
- full
- false
- bin\iPhoneSimulator\Debug\
- __UNIFIED__;__MOBILE__;__IOS__;DEBUG;ROS_SETUP
- prompt
- 4
- false
- x86_64
- Full
- true
-
- iPhone Developer
- false
- true
- --linkskip=nunit.runner.iOS
-
-
- none
- true
- bin\iPhoneSimulator\Release\
- __UNIFIED__;__MOBILE__;__IOS__;ROS_SETUP
- prompt
- 4
- Full
- x86_64
- false
-
- iPhone Developer
- --linkskip=nunit.runner.iOS
-
-
- true
- full
- false
- bin\iPhone\Debug\
- __UNIFIED__;__MOBILE__;__IOS__;DEBUG;ROS_SETUP
- prompt
- 4
- false
- ARMv7, ARM64
- iPhone Developer
- true
-
- true
- Full
- --linkskip=nunit.runner.iOS
-
-
- none
- true
- bin\iPhone\Release\
- __UNIFIED__;__MOBILE__;__IOS__;ROS_SETUP
- prompt
- 4
- ARMv7, ARM64
- false
- iPhone Developer
-
- Full
- --linkskip=nunit.runner.iOS
- Visual Studio: NuGet Tests Development
-
-
-
-
-
-
-
-
-
- Resources\ForMigrationsToCopyAndMigrate.realm
- PreserveNewest
-
-
- Resources\sync-1.x-encrypted.realm
- PreserveNewest
-
-
- Resources\sync-1.x.realm
- PreserveNewest
-
-
-
-
-
-
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
-
-
- ..\packages\Xamarin.Forms.2.3.4.224\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
-
-
-
-
- ..\packages\System.Runtime.Loader.4.0.0\lib\netstandard1.5\System.Runtime.Loader.dll
-
-
- ..\packages\NUnit.3.6.1\lib\Xamarin.iOS10\nunit.framework.dll
-
-
- ..\packages\Nito.Disposables.1.0.0\lib\portable45-net45+win8+wp8+wpa81\Nito.Disposables.dll
-
-
- ..\packages\Nito.AsyncEx.Tasks.1.1.0\lib\netstandard1.3\Nito.AsyncEx.Tasks.dll
-
-
- ..\packages\Nito.AsyncEx.Context.1.1.0\lib\netstandard1.3\Nito.AsyncEx.Context.dll
-
-
-
- ..\packages\DotNetCross.Memory.Unsafe.0.2.3.4\lib\netstandard1.0\DotNetCross.Memory.Unsafe.dll
-
-
- ..\packages\PCLStorage.1.0.2\lib\portable-Xamarin.iOS+Xamarin.Mac\PCLStorage.Abstractions.dll
-
-
- ..\packages\PCLStorage.1.0.2\lib\portable-Xamarin.iOS+Xamarin.Mac\PCLStorage.dll
-
-
- ..\packages\System.Reactive.Interfaces.3.1.1\lib\netstandard1.0\System.Reactive.Interfaces.dll
-
-
- ..\packages\System.Reactive.Core.3.1.1\lib\netstandard1.3\System.Reactive.Core.dll
-
-
- ..\packages\System.Reactive.Linq.3.1.1\lib\netstandard1.3\System.Reactive.Linq.dll
-
-
- ..\packages\System.Reactive.PlatformServices.3.1.1\lib\netstandard1.3\System.Reactive.PlatformServices.dll
-
-
- ..\..\..\dependencies\nunit.xamarin.3.6.1\Xamarin.iOS\nunit.runner.iOS.dll
-
-
- ..\packages\Realm.DataBinding.1.2.0\lib\Xamarin.iOS10\Realm.DataBinding.dll
-
-
- ..\packages\Remotion.Linq.2.1.2\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll
-
-
- ..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\packages\Realm.Database.3.0.0\lib\netstandard1.4\Realm.dll
-
-
- ..\packages\Realm.3.0.0\lib\netstandard1.4\Realm.Sync.dll
-
-
-
-
-
-
-
-
-
- nunit3-junit.xslt
- PreserveNewest
-
-
-
-
- AppDelegate.cs
-
-
- Main.cs
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/NuGetReleaseTests/Tests.iOS/packages.config b/Manual Tests/NuGetReleaseTests/Tests.iOS/packages.config
deleted file mode 100644
index 2777eaef86..0000000000
--- a/Manual Tests/NuGetReleaseTests/Tests.iOS/packages.config
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/Readme.md b/Manual Tests/Readme.md
deleted file mode 100644
index b441aa7d8a..0000000000
--- a/Manual Tests/Readme.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# Running manual/integration tests
-
-The NuGetReleaseTests project is a clone of the regular test projects that references the NuGet packages rather than the local projects.
-
-## Setting up ROS
-
-1. Download the latest [public ROS](https://realm.io/products/realm-mobile-platform/).
-1. Run `start-object-server.command` and create an admin user `a@a` with password `a`.
-1. Edit `configuration.yml`:
- 1. In the `https` section:
- 1. `enable: true`
- 1. `certificate_path: 'keys/127_0_0_1-chain.crt.pem'`
- 1. `private_key_path: 'keys/127_0_0_1-server.key.pem'`
-1. Copy `Tests/ROS/keys` to `path-to-ros/realm-object-server/object-server`
-
-## Setting up Android
-
-You need Android 5.0+ device to run all unit tests.
-1. Execute `adb reverse tcp:9080 tcp:9080`
-1. Execute `adb reverse tcp:9443 tcp:9443`
-
-## Setting up iOS
-
-If you're running a simulator, no additional setup is required.
-If you're running tests on a device, you need to update `Constants.ServerUrl` with the url of your server (make sure it's reachable from the device).
diff --git a/Manual Tests/Settings.StyleCop b/Manual Tests/Settings.StyleCop
deleted file mode 100644
index 805dec909e..0000000000
--- a/Manual Tests/Settings.StyleCop
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
- False
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/FodyWeavers.xml b/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/FodyWeavers.xml
deleted file mode 100644
index 6aa124364c..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/Properties/AssemblyInfo.cs b/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/Properties/AssemblyInfo.cs
deleted file mode 100644
index 801b949b56..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Resources;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("PurePCLViewModel")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("PurePCLViewModel")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: NeutralResourcesLanguage("en")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/PurePCLViewModel.csproj b/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/PurePCLViewModel.csproj
deleted file mode 100644
index f327a49412..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/PurePCLViewModel.csproj
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
- 10.0
- Debug
- AnyCPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}
- Library
- Properties
- PurePCLViewModel
- PurePCLViewModel
- en-US
- 512
- {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Profile259
- v4.5
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\packages\Realm.DataBinding.1.2.0\lib\netstandard1.0\Realm.DataBinding.dll
-
-
- ..\packages\DotNetCross.Memory.Unsafe.0.2.3.4\lib\netstandard1.0\DotNetCross.Memory.Unsafe.dll
-
-
- ..\packages\Remotion.Linq.2.1.2\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll
-
-
- ..\packages\Realm.Database.2.2.0\lib\portable-net45+sl5+wp8+wpa81+win8+monoandroid+Xamarin.iOS10+monotouch+Xamarin.Mac\Realm.dll
-
-
- ..\packages\Realm.2.2.0\lib\portable-net45+sl5+wp8+wpa81+win8+monoandroid+Xamarin.iOS10+monotouch+Xamarin.Mac\Realm.Sync.dll
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/ViewModel.cs b/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/ViewModel.cs
deleted file mode 100644
index 1ecbc21503..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/ViewModel.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Text;
-using System.ComponentModel;
-using Realms;
-using System.Linq;
-
-namespace PurePCLViewModel
-{
-
- class Hero : RealmObject
- {
- public string SuperName { get; set; }
- public int SuperScore { get; set; }
- }
-
- public class ViewModel : INotifyPropertyChanged
- {
- public string TheAnswer { get; private set; }
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- public ViewModel()
- {
- }
-
- public void TestRealm()
- {
- Realm.DeleteRealm(RealmConfiguration.DefaultConfiguration); // cleanup previous test run
- using (var _realm = Realm.GetInstance())
- {
- _realm.Write(() =>
- {
- for (int i = 0; i < 10; ++i) // quick loop to add a few objects
- {
- _realm.Add(new Hero
- {
- SuperName = $"Thor {i}",
- SuperScore = 10 * i
- });
- }
- });
-
- var numAwe = _realm.All().Count();
-
- var timeStamp = DateTimeOffset.Now.ToString();
- var sb = new StringBuilder();
- foreach (var aThor in _realm.All())
- {
- sb.AppendLine(aThor.SuperName); // get the names back out to prove that data saved
- }
-
- TheAnswer = $"{timeStamp}\n{numAwe} realm objects created:\n{sb.ToString()}";
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(TheAnswer))); // normally would be setter
- }
- }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/packages.config b/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/packages.config
deleted file mode 100644
index d7958923db..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/PurePCLViewModel/packages.config
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/README.md b/Manual Tests/ThreeLayerRealmXFNuGet/README.md
deleted file mode 100644
index a28f507616..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# About
-
-Disclaimer: this experiment acts as a testbed for multiple layers of PCL and_some_ databinding but should not be taken as an example of preferred architecture. It shows what is _technically possible_rather than what is _good_.
-
-The solution ThreeLayerRealmXFNuGet was created in VS2015 using _Xamarin Forms Portable_ template. It was later updated to use Xamarin Forms 2.0 which involved no code changes, just selecting a higher version in NuGet.
-
-Diving into giving PCL layering a full workout, it represents the typical approach of a user who uses Xamarin Forms in a PCL for their portable GUI as well having a separate ViewModel class in another PCL assembly.
-
-It is based on the adjacent `ThreeLayerRealmXF` but uses NuGet to get the Realm libraries rather than linking to local copies. As such, it allows for quick testing of our NuGet releases in a full application context.
-
-## The Layers
-
-* Platform-specific app such as `ThreeLayerRealmXFNuGet.IOS` or `ThreeLayerRealmXFNuGet.Droid`.
-* `ThreeLayerRealmXFNuGet` UI Layer of common Xamarin Forms UI.
-* `PurePCLViewModel` Sandwich filling invoked by `ThreeLayerRealmXFNuGet`.
-* `Realm.PCL` layer which invokes Realm via the _Bait and Switch_ pattern.
-
-## Build Notes
-
-`PurePCLViewModel` was created using the VS2015 template _Class Library (Portable)_ with default targets to match the Xamarin Forms PCL default:
-
-* .Net Framework 4.5
-* Windows 8
-* Windows Phone Silverlight 8
-* Windows Phone 8.1
-* Xamarin.Android
-* Xamarin.iOS
-* Xamarin.iOS (Classic)
-
-## Other Notes
-
-`ThreeLayerRealmXFNuGet.WinPhone` is not yet completed as we lack a Realm build for WinPhone
-
-### About the Binding
-
-If you are unfamiliar with the binding models of WPF or Xamarin Forms this may seem convoluted to you (it is!).
-
-if you look in the `ThreeLayerRealmXFNuGet` project at `App.cs` you can see the binding being created.
-
-The two key things are:
-
-1. set the `BindingContext` to something which descends from `INotityPropertyChanged` and
-2. use `SetBinding` to bind to a property within that object ( `_model` in this case)
-
-The `Model.TestRealm` method triggers a `PropertyChanged` with the important signature "TheAnswer" to indicate that property has changed and the binding should refresh our `boundLabel`.
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.sln b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.sln
deleted file mode 100644
index d15cce4e71..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.sln
+++ /dev/null
@@ -1,292 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeLayerRealmXFNuGet.iOS", "ThreeLayerRealmXFNuGet\ThreeLayerRealmXFNuGet.iOS\ThreeLayerRealmXFNuGet.iOS.csproj", "{F377984A-36A2-454B-AAAB-6E385048D5AB}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeLayerRealmXFNuGet.WinPhone", "ThreeLayerRealmXFNuGet\ThreeLayerRealmXFNuGet.WinPhone\ThreeLayerRealmXFNuGet.WinPhone.csproj", "{6EEDE0D8-0052-4733-92B9-EE3C40871F30}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeLayerRealmXFNuGet", "ThreeLayerRealmXFNuGet\ThreeLayerRealmXFNuGet\ThreeLayerRealmXFNuGet.csproj", "{4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PurePCLViewModel", "PurePCLViewModel\PurePCLViewModel.csproj", "{A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeLayerRealmXFNuGet.Droid", "ThreeLayerRealmXFNuGet\ThreeLayerRealmXFNuGet.Droid\ThreeLayerRealmXFNuGet.Droid.csproj", "{4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
- Ad-Hoc|ARM = Ad-Hoc|ARM
- Ad-Hoc|iPhone = Ad-Hoc|iPhone
- Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
- Ad-Hoc|x86 = Ad-Hoc|x86
- AppStore|Any CPU = AppStore|Any CPU
- AppStore|ARM = AppStore|ARM
- AppStore|iPhone = AppStore|iPhone
- AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
- AppStore|x86 = AppStore|x86
- Debug|Any CPU = Debug|Any CPU
- Debug|ARM = Debug|ARM
- Debug|iPhone = Debug|iPhone
- Debug|iPhoneSimulator = Debug|iPhoneSimulator
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|ARM = Release|ARM
- Release|iPhone = Release|iPhone
- Release|iPhoneSimulator = Release|iPhoneSimulator
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Ad-Hoc|x86.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|Any CPU.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|ARM.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|ARM.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|iPhone.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|iPhone.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|x86.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.AppStore|x86.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|ARM.Build.0 = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|iPhone.Build.0 = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|x86.ActiveCfg = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Debug|x86.Build.0 = Debug|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|Any CPU.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|ARM.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|ARM.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|iPhone.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|iPhone.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|x86.ActiveCfg = Release|Any CPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}.Release|x86.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Ad-Hoc|x86.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|Any CPU.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|ARM.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|ARM.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|iPhone.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|iPhone.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|x86.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.AppStore|x86.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|ARM.Build.0 = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|iPhone.Build.0 = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|x86.ActiveCfg = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Debug|x86.Build.0 = Debug|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|Any CPU.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|ARM.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|ARM.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|iPhone.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|iPhone.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|x86.ActiveCfg = Release|Any CPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}.Release|x86.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|ARM.ActiveCfg = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|ARM.Build.0 = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|ARM.Deploy.0 = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|x86.ActiveCfg = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|x86.Build.0 = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Ad-Hoc|x86.Deploy.0 = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|Any CPU.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|Any CPU.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|ARM.ActiveCfg = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|ARM.Build.0 = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|ARM.Deploy.0 = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|iPhone.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|iPhone.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|iPhone.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|x86.ActiveCfg = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|x86.Build.0 = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.AppStore|x86.Deploy.0 = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|ARM.ActiveCfg = Debug|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|ARM.Build.0 = Debug|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|ARM.Deploy.0 = Debug|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|iPhone.Build.0 = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|iPhone.Deploy.0 = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|x86.ActiveCfg = Debug|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|x86.Build.0 = Debug|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Debug|x86.Deploy.0 = Debug|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|Any CPU.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|ARM.ActiveCfg = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|ARM.Build.0 = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|ARM.Deploy.0 = Release|ARM
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|iPhone.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|iPhone.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|iPhone.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|x86.ActiveCfg = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|x86.Build.0 = Release|x86
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}.Release|x86.Deploy.0 = Release|x86
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Ad-Hoc|x86.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|Any CPU.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|ARM.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|ARM.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|iPhone.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|iPhone.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|x86.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.AppStore|x86.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|ARM.Build.0 = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|iPhone.Build.0 = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Debug|x86.Build.0 = Debug|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|Any CPU.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|ARM.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|ARM.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|iPhone.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|iPhone.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|x86.ActiveCfg = Release|Any CPU
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}.Release|x86.Build.0 = Release|Any CPU
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.AppStore|ARM.ActiveCfg = AppStore|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.AppStore|iPhone.Build.0 = AppStore|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.AppStore|x86.ActiveCfg = AppStore|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Debug|Any CPU.ActiveCfg = Debug|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Debug|ARM.ActiveCfg = Debug|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Debug|iPhone.ActiveCfg = Debug|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Debug|iPhone.Build.0 = Debug|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Debug|x86.ActiveCfg = Debug|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Release|Any CPU.ActiveCfg = Release|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Release|ARM.ActiveCfg = Release|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Release|iPhone.ActiveCfg = Release|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Release|iPhone.Build.0 = Release|iPhone
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}.Release|x86.ActiveCfg = Release|iPhone
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Ad-Hoc|x86.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|Any CPU.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|ARM.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|ARM.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|iPhone.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|iPhone.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|x86.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.AppStore|x86.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|ARM.Build.0 = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|iPhone.Build.0 = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|x86.ActiveCfg = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|x86.Build.0 = Debug|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|ARM.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|ARM.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|iPhone.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|iPhone.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|x86.ActiveCfg = Release|Any CPU
- {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|x86.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Assets/AboutAssets.txt b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Assets/AboutAssets.txt
deleted file mode 100644
index 5ddf08729b..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Assets/AboutAssets.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Any raw assets you want to be deployed with your application can be placed in
-this directory (and child directories) and given a Build Action of "AndroidAsset".
-
-These files will be deployed with you package and will be accessible using Android's
-AssetManager, like this:
-
-public class ReadAsset : Activity
-{
- protected override void OnCreate (Bundle bundle)
- {
- base.OnCreate (bundle);
-
- InputStream input = Assets.Open ("my_asset.txt");
- }
-}
-
-Additionally, some Android functions will automatically load asset files:
-
-Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/FodyWeavers.xml b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/FodyWeavers.xml
deleted file mode 100644
index 6aa124364c..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/MainActivity.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/MainActivity.cs
deleted file mode 100644
index 6fe9fd0107..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/MainActivity.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-
-using Android.App;
-using Android.Content.PM;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-using Android.OS;
-
-namespace ThreeLayerRealmXF.Droid {
- [Activity(Label = "ThreeLayerRealmXFNuGet", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
- public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity {
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- global::Xamarin.Forms.Forms.Init(this, bundle);
- LoadApplication(new App());
- }
- }
-}
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Properties/AndroidManifest.xml b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Properties/AndroidManifest.xml
deleted file mode 100644
index 33b6a14be2..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Properties/AndroidManifest.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
- ThreeLayerRealmXFNuGet
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Properties/AssemblyInfo.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Properties/AssemblyInfo.cs
deleted file mode 100644
index 0cdd3e945f..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using Android.App;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ThreeLayerRealmXFNuGet.Droid")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ThreeLayerRealmXFNuGet.Droid")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-
-// Add some common permissions, these can be removed if not needed
-[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
-[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/AboutResources.txt b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/AboutResources.txt
deleted file mode 100644
index cb30f20b1c..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/AboutResources.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-Images, layout descriptions, binary blobs and string dictionaries can be included
-in your application as resource files. Various Android APIs are designed to
-operate on the resource IDs instead of dealing with images, strings or binary blobs
-directly.
-
-For example, a sample Android app that contains a user interface layout (main.xml),
-an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
-would keep its resources in the "Resources" directory of the application:
-
-Resources/
- drawable-hdpi/
- icon.png
-
- drawable-ldpi/
- icon.png
-
- drawable-mdpi/
- icon.png
-
- layout/
- main.xml
-
- values/
- strings.xml
-
-In order to get the build system to recognize Android resources, set the build action to
-"AndroidResource". The native Android APIs do not operate directly with filenames, but
-instead operate on resource IDs. When you compile an Android application that uses resources,
-the build system will package the resources for distribution and generate a class called
-"Resource" that contains the tokens for each one of the resources included. For example,
-for the above Resources layout, this is what the Resource class would expose:
-
-public class Resource {
- public class drawable {
- public const int icon = 0x123;
- }
-
- public class layout {
- public const int main = 0x456;
- }
-
- public class strings {
- public const int first_string = 0xabc;
- public const int second_string = 0xbcd;
- }
-}
-
-You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
-to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
-string in the dictionary file values/strings.xml.
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-hdpi/icon.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-hdpi/icon.png
deleted file mode 100644
index 964f110abb..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-hdpi/icon.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-xhdpi/icon.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-xhdpi/icon.png
deleted file mode 100644
index 3c01e60ced..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-xxhdpi/icon.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-xxhdpi/icon.png
deleted file mode 100644
index 0d8c1c57dc..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable-xxhdpi/icon.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable/icon.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable/icon.png
deleted file mode 100644
index b0ba7150f4..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/Resources/drawable/icon.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/ThreeLayerRealmXFNuGet.Droid.csproj b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/ThreeLayerRealmXFNuGet.Droid.csproj
deleted file mode 100644
index a60224c883..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/ThreeLayerRealmXFNuGet.Droid.csproj
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {4A3F2108-00E0-4BE6-A4D4-B8C9F573B166}
- {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Properties
- ThreeLayerRealmXFNuGet.Droid
- ThreeLayerRealmXFNuGet.Droid
- 512
- true
- Resources\Resource.Designer.cs
- Off
- Properties\AndroidManifest.xml
- True
- v8.1
-
-
-
-
-
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- None
-
-
- full
- true
- bin\Release\
- TRACE
- prompt
- 4
- False
- armeabi;armeabi-v7a;x86;arm64-v8a;x86_64
-
-
-
-
-
-
-
-
-
-
- ..\..\packages\DotNetCross.Memory.Unsafe.0.2.3.4\lib\netstandard1.0\DotNetCross.Memory.Unsafe.dll
-
-
-
-
- ..\..\packages\Realm.DataBinding.1.2.0\lib\MonoAndroid44\Realm.DataBinding.dll
-
-
- ..\..\packages\Remotion.Linq.2.1.2\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll
-
-
- ..\..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
-
-
- ..\..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
-
-
- ..\..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll
-
-
- ..\..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll
-
-
- ..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll
-
-
- ..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll
-
-
- ..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
-
-
- ..\..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll
-
-
- ..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\FormsViewGroup.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Core.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
-
-
- ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\..\packages\Realm.Database.2.2.0\lib\netstandard1.4\Realm.dll
-
-
- ..\..\packages\Realm.2.2.0\lib\netstandard1.4\Realm.Sync.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ThreeLayerRealmXFNuGet
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/packages.config b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/packages.config
deleted file mode 100644
index 4af1f8da4b..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.Droid/packages.config
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/App.xaml b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/App.xaml
deleted file mode 100644
index 8497aa1b19..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/App.xaml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/App.xaml.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/App.xaml.cs
deleted file mode 100644
index fcfa715b43..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/App.xaml.cs
+++ /dev/null
@@ -1,214 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Resources;
-using System.Windows;
-using System.Windows.Markup;
-using System.Windows.Navigation;
-using Microsoft.Phone.Controls;
-using Microsoft.Phone.Shell;
-using ThreeLayerRealmXF.WinPhone.Resources;
-
-namespace ThreeLayerRealmXF.WinPhone {
- public partial class App : Application {
- ///
- /// Provides easy access to the root frame of the Phone Application.
- ///
- /// The root frame of the Phone Application.
- public static PhoneApplicationFrame RootFrame { get; private set; }
-
- ///
- /// Constructor for the Application object.
- ///
- public App()
- {
- // Global handler for uncaught exceptions.
- UnhandledException += Application_UnhandledException;
-
- // Standard XAML initialization
- InitializeComponent();
-
- // Phone-specific initialization
- InitializePhoneApplication();
-
- // Language display initialization
- InitializeLanguage();
-
- // Show graphics profiling information while debugging.
- if (Debugger.IsAttached) {
- // Display the current frame rate counters.
- Application.Current.Host.Settings.EnableFrameRateCounter = true;
-
- // Show the areas of the app that are being redrawn in each frame.
- //Application.Current.Host.Settings.EnableRedrawRegions = true;
-
- // Enable non-production analysis visualization mode,
- // which shows areas of a page that are handed off to GPU with a colored overlay.
- //Application.Current.Host.Settings.EnableCacheVisualization = true;
-
- // Prevent the screen from turning off while under the debugger by disabling
- // the application's idle detection.
- // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
- // and consume battery power when the user is not using the phone.
- PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
- }
-
- }
-
- // Code to execute when the application is launching (eg, from Start)
- // This code will not execute when the application is reactivated
- private void Application_Launching(object sender, LaunchingEventArgs e)
- {
- }
-
- // Code to execute when the application is activated (brought to foreground)
- // This code will not execute when the application is first launched
- private void Application_Activated(object sender, ActivatedEventArgs e)
- {
- }
-
- // Code to execute when the application is deactivated (sent to background)
- // This code will not execute when the application is closing
- private void Application_Deactivated(object sender, DeactivatedEventArgs e)
- {
- }
-
- // Code to execute when the application is closing (eg, user hit Back)
- // This code will not execute when the application is deactivated
- private void Application_Closing(object sender, ClosingEventArgs e)
- {
- }
-
- // Code to execute if a navigation fails
- private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
- {
- if (Debugger.IsAttached) {
- // A navigation has failed; break into the debugger
- Debugger.Break();
- }
- }
-
- // Code to execute on Unhandled Exceptions
- private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
- {
- if (Debugger.IsAttached) {
- // An unhandled exception has occurred; break into the debugger
- Debugger.Break();
- }
- }
-
- #region Phone application initialization
-
- // Avoid double-initialization
- private bool phoneApplicationInitialized = false;
-
- // Do not add any additional code to this method
- private void InitializePhoneApplication()
- {
- if (phoneApplicationInitialized)
- return;
-
- // Create the frame but don't set it as RootVisual yet; this allows the splash
- // screen to remain active until the application is ready to render.
- RootFrame = new PhoneApplicationFrame();
- RootFrame.Navigated += CompleteInitializePhoneApplication;
-
- // Handle navigation failures
- RootFrame.NavigationFailed += RootFrame_NavigationFailed;
-
- // Handle reset requests for clearing the backstack
- RootFrame.Navigated += CheckForResetNavigation;
-
- // Ensure we don't initialize again
- phoneApplicationInitialized = true;
- }
-
- // Do not add any additional code to this method
- private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
- {
- // Set the root visual to allow the application to render
- if (RootVisual != RootFrame)
- RootVisual = RootFrame;
-
- // Remove this handler since it is no longer needed
- RootFrame.Navigated -= CompleteInitializePhoneApplication;
- }
-
- private void CheckForResetNavigation(object sender, NavigationEventArgs e)
- {
- // If the app has received a 'reset' navigation, then we need to check
- // on the next navigation to see if the page stack should be reset
- if (e.NavigationMode == NavigationMode.Reset)
- RootFrame.Navigated += ClearBackStackAfterReset;
- }
-
- private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)
- {
- // Unregister the event so it doesn't get called again
- RootFrame.Navigated -= ClearBackStackAfterReset;
-
- // Only clear the stack for 'new' (forward) and 'refresh' navigations
- if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh)
- return;
-
- // For UI consistency, clear the entire page stack
- while (RootFrame.RemoveBackEntry() != null) {
- ; // do nothing
- }
- }
-
- #endregion
-
- // Initialize the app's font and flow direction as defined in its localized resource strings.
- //
- // To ensure that the font of your application is aligned with its supported languages and that the
- // FlowDirection for each of those languages follows its traditional direction, ResourceLanguage
- // and ResourceFlowDirection should be initialized in each resx file to match these values with that
- // file's culture. For example:
- //
- // AppResources.es-ES.resx
- // ResourceLanguage's value should be "es-ES"
- // ResourceFlowDirection's value should be "LeftToRight"
- //
- // AppResources.ar-SA.resx
- // ResourceLanguage's value should be "ar-SA"
- // ResourceFlowDirection's value should be "RightToLeft"
- //
- // For more info on localizing Windows Phone apps see http://go.microsoft.com/fwlink/?LinkId=262072.
- //
- private void InitializeLanguage()
- {
- try {
- // Set the font to match the display language defined by the
- // ResourceLanguage resource string for each supported language.
- //
- // Fall back to the font of the neutral language if the Display
- // language of the phone is not supported.
- //
- // If a compiler error is hit then ResourceLanguage is missing from
- // the resource file.
- RootFrame.Language = XmlLanguage.GetLanguage(AppResources.ResourceLanguage);
-
- // Set the FlowDirection of all elements under the root frame based
- // on the ResourceFlowDirection resource string for each
- // supported language.
- //
- // If a compiler error is hit then ResourceFlowDirection is missing from
- // the resource file.
- FlowDirection flow = (FlowDirection)Enum.Parse(typeof(FlowDirection), AppResources.ResourceFlowDirection);
- RootFrame.FlowDirection = flow;
- }
- catch {
- // If an exception is caught here it is most likely due to either
- // ResourceLangauge not being correctly set to a supported language
- // code or ResourceFlowDirection is set to a value other than LeftToRight
- // or RightToLeft.
-
- if (Debugger.IsAttached) {
- Debugger.Break();
- }
-
- throw;
- }
- }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/AlignmentGrid.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/AlignmentGrid.png
deleted file mode 100644
index f7d2e97804..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/AlignmentGrid.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/ApplicationIcon.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/ApplicationIcon.png
deleted file mode 100644
index d2b5c9524d..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/ApplicationIcon.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileLarge.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileLarge.png
deleted file mode 100644
index 8856d9a996..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileLarge.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileMedium.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileMedium.png
deleted file mode 100644
index baab0030a7..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileMedium.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileSmall.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileSmall.png
deleted file mode 100644
index d44d803a52..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/FlipCycleTileSmall.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/IconicTileMediumLarge.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/IconicTileMediumLarge.png
deleted file mode 100644
index 2c904389ac..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/IconicTileMediumLarge.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/IconicTileSmall.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/IconicTileSmall.png
deleted file mode 100644
index 76d82e0f08..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Assets/Tiles/IconicTileSmall.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/LocalizedStrings.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/LocalizedStrings.cs
deleted file mode 100644
index df28da38f9..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/LocalizedStrings.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using ThreeLayerRealmXF.WinPhone.Resources;
-
-namespace ThreeLayerRealmXF.WinPhone {
- ///
- /// Provides access to string resources.
- ///
- public class LocalizedStrings {
- private static AppResources _localizedResources = new AppResources();
-
- public AppResources LocalizedResources { get { return _localizedResources; } }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/MainPage.xaml b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/MainPage.xaml
deleted file mode 100644
index 94649c80f3..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/MainPage.xaml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/MainPage.xaml.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/MainPage.xaml.cs
deleted file mode 100644
index 55fd281b30..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/MainPage.xaml.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Navigation;
-using Microsoft.Phone.Controls;
-using Microsoft.Phone.Shell;
-
-namespace ThreeLayerRealmXF.WinPhone {
- public partial class MainPage : global::Xamarin.Forms.Platform.WinPhone.FormsApplicationPage {
- public MainPage()
- {
- InitializeComponent();
- SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
-
- global::Xamarin.Forms.Forms.Init();
- LoadApplication(new ThreeLayerRealmXF.App());
- }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/AppManifest.xml b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/AppManifest.xml
deleted file mode 100644
index a955232752..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/AppManifest.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/AssemblyInfo.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/AssemblyInfo.cs
deleted file mode 100644
index 60f22e3035..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Resources;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ThreeLayerRealmXF.WinPhone")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ThreeLayerRealmXF.WinPhone")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("65077432-0c92-466b-b68d-911a8ec84f1d")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: NeutralResourcesLanguageAttribute("en-US")]
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/WMAppManifest.xml b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/WMAppManifest.xml
deleted file mode 100644
index 2f34344c70..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Properties/WMAppManifest.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
- Assets\ApplicationIcon.png
-
-
-
-
-
-
-
-
-
-
-
-
-
- Assets\Tiles\FlipCycleTileSmall.png
- 0
- Assets\Tiles\FlipCycleTileMedium.png
- ThreeLayerRealmXF.WinPhone
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/README_FIRST.txt b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/README_FIRST.txt
deleted file mode 100644
index ce40c013bb..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/README_FIRST.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-For the Windows Phone toolkit make sure that you have
-marked the icons in the "Toolkit.Content" folder as content. That way they
-can be used as the icons for the ApplicationBar control.
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Resources/AppResources.Designer.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Resources/AppResources.Designer.cs
deleted file mode 100644
index 6496e492fa..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Resources/AppResources.Designer.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.17626
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace ThreeLayerRealmXF.WinPhone.Resources {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- public class AppResources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal AppResources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ThreeLayerRealmXF.WinPhone.Resources.AppResources", typeof(AppResources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to LeftToRight.
- ///
- public static string ResourceFlowDirection
- {
- get
- {
- return ResourceManager.GetString("ResourceFlowDirection", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to us-EN.
- ///
- public static string ResourceLanguage
- {
- get
- {
- return ResourceManager.GetString("ResourceLanguage", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to MY APPLICATION.
- ///
- public static string ApplicationTitle
- {
- get
- {
- return ResourceManager.GetString("ApplicationTitle", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to button.
- ///
- public static string AppBarButtonText
- {
- get
- {
- return ResourceManager.GetString("AppBarButtonText", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to menu item.
- ///
- public static string AppBarMenuItemText
- {
- get
- {
- return ResourceManager.GetString("AppBarMenuItemText", resourceCulture);
- }
- }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Resources/AppResources.resx b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Resources/AppResources.resx
deleted file mode 100644
index 569bf520d0..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Resources/AppResources.resx
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- LeftToRight
- Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language
-
-
- en-US
- Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.
-
-
- MY APPLICATION
-
-
- add
-
-
- Menu Item
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/SplashScreenImage.jpg b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/SplashScreenImage.jpg
deleted file mode 100644
index 666f7c537f..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/SplashScreenImage.jpg and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/ThreeLayerRealmXFNuGet.WinPhone.csproj b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/ThreeLayerRealmXFNuGet.WinPhone.csproj
deleted file mode 100644
index b045ece24d..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/ThreeLayerRealmXFNuGet.WinPhone.csproj
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {6EEDE0D8-0052-4733-92B9-EE3C40871F30}
- {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
- Library
- Properties
- ThreeLayerRealmXFNuGet.WinPhone
- ThreeLayerRealmXFNuGet.WinPhone
- WindowsPhone
- v8.0
- $(TargetFrameworkVersion)
- true
-
-
- true
- true
- PhoneApp1_$(Configuration)_$(Platform).xap
- Properties\AppManifest.xml
- ThreeLayerRealmXFNuGet.WinPhone.App
- true
- 11.0
- true
-
-
-
-
- true
- full
- false
- Bin\Debug
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\Release
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- true
- full
- false
- Bin\x86\Debug
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\x86\Release
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- true
- full
- false
- Bin\ARM\Debug
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\ARM\Release
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
-
- App.xaml
-
-
-
- MainPage.xaml
-
-
-
- True
- True
- AppResources.resx
-
-
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
-
-
-
-
- Designer
-
-
-
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
- PublicResXFileCodeGenerator
- AppResources.Designer.cs
-
-
-
-
- ThreeLayerRealmXFNuGet
-
-
-
-
- ..\..\packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll
- True
-
-
- ..\..\packages\Xamarin.Forms.1.3.3.6323\lib\WP80\Xamarin.Forms.Core.dll
- True
-
-
- ..\..\packages\Xamarin.Forms.1.3.3.6323\lib\WP80\Xamarin.Forms.Platform.WP8.dll
- True
-
-
- ..\..\packages\Xamarin.Forms.1.3.3.6323\lib\WP80\Xamarin.Forms.Xaml.dll
- True
-
-
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Add.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Add.png
deleted file mode 100644
index 4b524d6f14..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Add.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Cancel.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Cancel.png
deleted file mode 100644
index 4dd724f087..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Cancel.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Check.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Check.png
deleted file mode 100644
index 7a07466687..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Check.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Delete.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Delete.png
deleted file mode 100644
index 95bb16dabe..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Delete.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Select.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Select.png
deleted file mode 100644
index 995deaaafb..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/Toolkit.Content/ApplicationBar.Select.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/packages.config b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/packages.config
deleted file mode 100644
index 25f9dd7967..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.WinPhone/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/AppDelegate.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/AppDelegate.cs
deleted file mode 100644
index 192e4dd9c2..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/AppDelegate.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using Foundation;
-using UIKit;
-
-namespace ThreeLayerRealmXF.iOS {
- // The UIApplicationDelegate for the application. This class is responsible for launching the
- // User Interface of the application, as well as listening (and optionally responding) to
- // application events from iOS.
- [Register("AppDelegate")]
- public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate {
- //
- // This method is invoked when the application has loaded and is ready to run. In this
- // method you should instantiate the window, load the UI into it and then make the window
- // visible.
- //
- // You have 17 seconds to return from this method, or iOS will terminate your application.
- //
- public override bool FinishedLaunching(UIApplication app, NSDictionary options)
- {
- global::Xamarin.Forms.Forms.Init();
- LoadApplication(new App());
-
- return base.FinishedLaunching(app, options);
- }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Entitlements.plist b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Entitlements.plist
deleted file mode 100644
index e9a3005f78..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Entitlements.plist
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/FodyWeavers.xml b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/FodyWeavers.xml
deleted file mode 100644
index 6aa124364c..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Info.plist b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Info.plist
deleted file mode 100644
index 2a16c93a4b..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Info.plist
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
- UIDeviceFamily
-
- 1
- 2
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- MinimumOSVersion
- 8.1
- CFBundleDisplayName
- ThreeLayerRealmXF
- CFBundleIdentifier
- io.realm.ThreeLayerRealmXF
- CFBundleVersion
- 1.0
- CFBundleIconFiles
-
- Icon-60@2x
- Icon-60@3x
- Icon-76
- Icon-76@2x
- Default
- Default@2x
- Default-568h@2x
- Default-Portrait
- Default-Portrait@2x
- Icon-Small-40
- Icon-Small-40@2x
- Icon-Small-40@3x
- Icon-Small
- Icon-Small@2x
- Icon-Small@3x
-
- UILaunchStoryboardName
- LaunchScreen
- CFBundleShortVersionString
- 1.0
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Main.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Main.cs
deleted file mode 100644
index de4a58ab54..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Main.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using Foundation;
-using UIKit;
-
-namespace ThreeLayerRealmXF.iOS {
- public class Application {
- // This is the main entry point of the application.
- static void Main(string[] args)
- {
- // if you want to use a different Application Delegate class from "AppDelegate"
- // you can specify it here.
- UIApplication.Main(args, null, "AppDelegate");
- }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Properties/AssemblyInfo.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Properties/AssemblyInfo.cs
deleted file mode 100644
index 8456796ab9..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ThreeLayerRealmXF.iOS")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ThreeLayerRealmXF.iOS")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-568h@2x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-568h@2x.png
deleted file mode 100644
index 26c6461e50..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-568h@2x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-Portrait.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-Portrait.png
deleted file mode 100644
index 5d0d1ab4c6..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-Portrait.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-Portrait@2x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-Portrait@2x.png
deleted file mode 100644
index 0ee2688e8f..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default-Portrait@2x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default.png
deleted file mode 100644
index b74643c0aa..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default@2x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default@2x.png
deleted file mode 100644
index dbd6bd3e86..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Default@2x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-60@2x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-60@2x.png
deleted file mode 100644
index 4b03c42703..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-60@2x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-60@3x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-60@3x.png
deleted file mode 100644
index b03ca1bbc6..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-60@3x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-76.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-76.png
deleted file mode 100644
index 587982e2a6..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-76.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-76@2x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-76@2x.png
deleted file mode 100644
index cd4e2c8fe7..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-76@2x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40.png
deleted file mode 100644
index 6acff94417..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40@2x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40@2x.png
deleted file mode 100644
index b833aac26f..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40@2x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40@3x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40@3x.png
deleted file mode 100644
index ab8654e499..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small-40@3x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small.png
deleted file mode 100644
index 33db7e7141..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small@2x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small@2x.png
deleted file mode 100644
index bf45e25929..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small@2x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small@3x.png b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small@3x.png
deleted file mode 100644
index 7ad3891b95..0000000000
Binary files a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/Icon-Small@3x.png and /dev/null differ
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/LaunchScreen.storyboard b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/LaunchScreen.storyboard
deleted file mode 100644
index a639c2f1a5..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/Resources/LaunchScreen.storyboard
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/ThreeLayerRealmXFNuGet.iOS.csproj b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/ThreeLayerRealmXFNuGet.iOS.csproj
deleted file mode 100644
index 83d689a2b1..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/ThreeLayerRealmXFNuGet.iOS.csproj
+++ /dev/null
@@ -1,173 +0,0 @@
-
-
-
-
- Debug
- iPhoneSimulator
- {F377984A-36A2-454B-AAAB-6E385048D5AB}
- {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Exe
- ThreeLayerRealmXFNuGet.iOS
- Resources
- ThreeLayerRealmXFNuGetiOS
-
-
-
-
- true
- full
- false
- bin\iPhoneSimulator\Debug
- DEBUG
- prompt
- 4
- false
- i386, x86_64
- None
- true
- Visual Studio: ThreeLayerRealmXF Development
- iPhone Developer: Nikola Irinchev (K299G48R8B)
-
-
- none
- true
- bin\iPhoneSimulator\Release
- prompt
- 4
- None
- i386, x86_64
- false
-
-
- true
- full
- false
- bin\iPhone\Debug
- DEBUG
- prompt
- 4
- false
- ARMv7, ARM64
- iPhone Developer
- true
- Entitlements.plist
-
-
- none
- true
- bin\iPhone\Release
- prompt
- 4
- ARMv7, ARM64
- false
- iPhone Developer
- Entitlements.plist
-
-
- none
- True
- bin\iPhone\Ad-Hoc
- prompt
- 4
- False
- ARMv7, ARM64
- True
- Automatic:AdHoc
- iPhone Distribution
- Entitlements.plist
-
-
- none
- True
- bin\iPhone\AppStore
- prompt
- 4
- False
- ARMv7, ARM64
- Automatic:AppStore
- iPhone Distribution
- Entitlements.plist
-
-
-
-
-
-
-
-
-
-
-
-
- ThreeLayerRealmXFNuGet
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\..\packages\Realm.DataBinding.1.2.0\lib\Xamarin.iOS10\Realm.DataBinding.dll
-
-
- ..\..\packages\Remotion.Linq.2.1.2\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll
-
-
- ..\..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
-
-
- ..\..\packages\DotNetCross.Memory.Unsafe.0.2.3.4\lib\netstandard1.0\DotNetCross.Memory.Unsafe.dll
-
-
- ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\..\packages\Realm.Database.2.2.0\lib\netstandard1.4\Realm.dll
-
-
- ..\..\packages\Realm.2.2.0\lib\netstandard1.4\Realm.Sync.dll
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/packages.config b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/packages.config
deleted file mode 100644
index 0de0551de6..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.iOS/packages.config
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/App.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/App.cs
deleted file mode 100644
index 2aa2b36a6d..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/App.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using Xamarin.Forms;
-
-namespace ThreeLayerRealmXF {
- public class App : Application
- {
-
- private readonly PurePCLViewModel.ViewModel _model;
-
- public App()
- {
- _model = new PurePCLViewModel.ViewModel();
-
- BindingContext = _model;
- var boundLabel = new Label
- {
- XAlign = TextAlignment.Center,
- Text = ""
- };
- boundLabel.SetBinding(Label.TextProperty, new Binding("TheAnswer"));
-
- var button = new Button()
- {
- Text = "Test Realm",
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- };
- button.Clicked += (s, e) =>
- {
- _model.TestRealm();
- };
-
- // The root page of your application
- MainPage = new ContentPage
- {
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- new Label {
- XAlign = TextAlignment.Center,
- Text = "Welcome to ThreeLayer PCL in Forms!"
- },
- button,
- boundLabel
- }
- }
- };
- }
-
- protected override void OnStart()
- {
- // Handle when your app starts
- }
-
- protected override void OnSleep()
- {
- // Handle when your app sleeps
- }
-
- protected override void OnResume()
- {
- // Handle when your app resumes
- }
- }
-}
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/GettingStarted.Xamarin b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/GettingStarted.Xamarin
deleted file mode 100644
index f31b0091ce..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/GettingStarted.Xamarin
+++ /dev/null
@@ -1,4 +0,0 @@
-
- GS\XF\CS\App\GettingStarted.html
- false
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/Properties/AssemblyInfo.cs b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/Properties/AssemblyInfo.cs
deleted file mode 100644
index 7c77a3dc61..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Resources;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ThreeLayerRealmXF")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ThreeLayerRealmXF")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: NeutralResourcesLanguage("en")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.csproj b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.csproj
deleted file mode 100644
index 44bb89f318..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet.csproj
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
- 10.0
- Debug
- AnyCPU
- {4115119F-5DDD-4CCA-8A2F-5E9DFC906F35}
- Library
- Properties
- ThreeLayerRealmXFNuGet
- ThreeLayerRealmXFNuGet
- v4.5
- Profile78
- 512
- {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
-
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
- {A2705D5C-9F10-4A8B-9EBC-D4369E8A4D62}
- PurePCLViewModel
-
-
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll
-
-
- ..\..\packages\Xamarin.Forms.2.4.0.282\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll
-
-
-
-
-
\ No newline at end of file
diff --git a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/packages.config b/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/packages.config
deleted file mode 100644
index f61e8904fb..0000000000
--- a/Manual Tests/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/ThreeLayerRealmXFNuGet/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 4b06d76536..41a99c7205 100644
--- a/README.md
+++ b/README.md
@@ -79,6 +79,4 @@ not eligible to receive the product under U.S. law.**
**_If you use Realm and are happy with it, all we ask is that you please consider sending out a tweet mentioning [@realm](https://twitter.com/realm) to share your thoughts!_**
-**_And if you don't like it, please let us know what you would like improved, so we can fix it!_**
-
-![analytics](https://ga-beacon.appspot.com/UA-50247013-2/realm-dotnet/README?pixel)
+**_And if you don't like it, please let us know what you would like improved, so we can fix it!_**
\ No newline at end of file
diff --git a/Realm - Windows.sln b/Realm - Windows.sln
index b3311f30d0..d9c886ec58 100644
--- a/Realm - Windows.sln
+++ b/Realm - Windows.sln
@@ -1,6 +1,7 @@
+
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
-VisualStudioVersion = 16.0.29424.173
+VisualStudioVersion = 16.0.28621.142
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Realm", "Realm", "{50F058DF-2B41-403C-BB73-8B4180D1CF39}"
ProjectSection(SolutionItems) = preProject
@@ -10,9 +11,6 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm", "Realm\Realm\Realm.csproj", "{C0DB0E07-4FBC-44D1-8E84-A074497385C6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D10BE048-9C20-4B8B-BE5B-48CC55F8BB07}"
- ProjectSection(SolutionItems) = preProject
- Tests\Settings.StyleCop = Tests\Settings.StyleCop
- EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.UWP", "Tests\Tests.UWP\Tests.UWP.csproj", "{159A55AF-9531-4107-8444-CA9C96107EF5}"
ProjectSection(ProjectDependencies) = postProject
@@ -26,6 +24,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CHANGELOG.md = CHANGELOG.md
Directory.build.props = Directory.build.props
global.json = global.json
+ global.ruleset = global.ruleset
+ stylecop.json = stylecop.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.Fody", "Realm\Realm.Fody\Realm.Fody.csproj", "{CDAB5FEE-CC5D-4EFA-807F-F1B974047BE7}"
@@ -46,14 +46,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyToProcess", "Tests\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.Fody.Tests", "Tests\Weaver\Realm.Fody.Tests\Realm.Fody.Tests.csproj", "{D8DF24A7-E618-4A0F-ABC4-97AC823BD6A3}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Native", "Native", "{0AEA39B5-0D91-4334-81F9-9D45415FD36B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "realm-object-store", "wrappers\cmake\Windows\Debug-x64\src\object-store\src\realm-object-store.vcxproj", "{C7C69F12-F219-3414-8F95-58D1F5D29158}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "realm-wrappers", "wrappers\cmake\Windows\Debug-Win32\src\realm-wrappers.vcxproj", "{7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "realm-wrappers", "wrappers\cmake\Windows\Debug-x64\src\realm-wrappers.vcxproj", "{C14A2A2C-7CC6-3592-860B-A67089682AA5}"
- ProjectSection(ProjectDependencies) = postProject
- {C7C69F12-F219-3414-8F95-58D1F5D29158} = {C7C69F12-F219-3414-8F95-58D1F5D29158}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "realm-object-store", "wrappers\cmake\Windows\Debug-Win32\src\object-store\src\realm-object-store.vcxproj", "{BC80B5C6-5AF4-30F4-803D-3844579C103B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -144,23 +139,11 @@ Global
{159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x86.Build.0 = Debug|x86
{159A55AF-9531-4107-8444-CA9C96107EF5}.Debug|x86.Deploy.0 = Debug|x86
{159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|Any CPU.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|Any CPU.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|Any CPU.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|ARM.ActiveCfg = Release|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|ARM.Build.0 = Release|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|ARM.Deploy.0 = Release|ARM
{159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|iPhone.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|iPhone.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|iPhone.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|iPhoneSimulator.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|iPhoneSimulator.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|iPhoneSimulator.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|x64.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|x64.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|x64.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|x86.ActiveCfg = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|x86.Build.0 = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.MinSizeRel|x86.Deploy.0 = Release|x86
{159A55AF-9531-4107-8444-CA9C96107EF5}.Release|Any CPU.ActiveCfg = Release|x86
{159A55AF-9531-4107-8444-CA9C96107EF5}.Release|ARM.ActiveCfg = Release|ARM
{159A55AF-9531-4107-8444-CA9C96107EF5}.Release|ARM.Build.0 = Release|ARM
@@ -174,23 +157,11 @@ Global
{159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x86.Build.0 = Release|x86
{159A55AF-9531-4107-8444-CA9C96107EF5}.Release|x86.Deploy.0 = Release|x86
{159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|Any CPU.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|Any CPU.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|ARM.ActiveCfg = Release|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|ARM.Build.0 = Release|ARM
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|ARM.Deploy.0 = Release|ARM
{159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|iPhone.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|iPhone.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|iPhone.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|iPhoneSimulator.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|x64.ActiveCfg = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|x64.Build.0 = Release|x64
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|x64.Deploy.0 = Release|x64
{159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|x86.ActiveCfg = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|x86.Build.0 = Release|x86
- {159A55AF-9531-4107-8444-CA9C96107EF5}.RelWithDebInfo|x86.Deploy.0 = Release|x86
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -204,17 +175,11 @@ Global
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x86.ActiveCfg = Debug|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x86.Build.0 = Debug|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|ARM.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|ARM.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|iPhone.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|iPhone.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|iPhoneSimulator.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|x64.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|x64.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|x86.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.MinSizeRel|x86.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|Any CPU.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|ARM.ActiveCfg = Release|Any CPU
@@ -228,17 +193,11 @@ Global
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x86.ActiveCfg = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x86.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|ARM.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|ARM.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
- {3A6CC342-40D0-4487-9964-DDAEBA628199}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{CDAB5FEE-CC5D-4EFA-807F-F1B974047BE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDAB5FEE-CC5D-4EFA-807F-F1B974047BE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDAB5FEE-CC5D-4EFA-807F-F1B974047BE7}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -300,23 +259,11 @@ Global
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|x86.ActiveCfg = Debug|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|x86.Build.0 = Debug|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|Any CPU.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|ARM.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|ARM.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|ARM.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|iPhone.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|iPhone.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|iPhone.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|iPhoneSimulator.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|iPhoneSimulator.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|x64.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|x64.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|x64.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|x86.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|x86.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.MinSizeRel|x86.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|Any CPU.Build.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|ARM.ActiveCfg = Release|Any CPU
@@ -330,23 +277,11 @@ Global
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|x86.ActiveCfg = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|x86.Build.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|Any CPU.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|ARM.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|ARM.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|ARM.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|iPhone.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|iPhoneSimulator.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|x64.Deploy.0 = Release|Any CPU
{10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
- {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.RelWithDebInfo|x86.Deploy.0 = Release|Any CPU
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator
@@ -360,17 +295,11 @@ Global
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Debug|x86.Build.0 = Debug|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|Any CPU.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|Any CPU.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|ARM.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|ARM.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|iPhone.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|iPhone.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|x64.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|x64.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|x86.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.MinSizeRel|x86.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Release|ARM.ActiveCfg = Release|iPhoneSimulator
@@ -384,17 +313,11 @@ Global
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Release|x86.ActiveCfg = Release|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.Release|x86.Build.0 = Release|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|Any CPU.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|Any CPU.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|ARM.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|ARM.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|iPhone.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|iPhone.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|x64.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|x64.Build.0 = Release|iPhone
{F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|x86.ActiveCfg = Release|iPhone
- {F67B1BEB-4157-45A2-B310-4AA8F99C750E}.RelWithDebInfo|x86.Build.0 = Release|iPhone
{78799FCD-BE2E-4ECE-A52E-662846615B58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78799FCD-BE2E-4ECE-A52E-662846615B58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78799FCD-BE2E-4ECE-A52E-662846615B58}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -635,62 +558,62 @@ Global
{D8DF24A7-E618-4A0F-ABC4-97AC823BD6A3}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{D8DF24A7-E618-4A0F-ABC4-97AC823BD6A3}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{D8DF24A7-E618-4A0F-ABC4-97AC823BD6A3}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Debug|Any CPU.ActiveCfg = Debug|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Debug|ARM.ActiveCfg = Debug|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Debug|iPhone.ActiveCfg = Debug|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Debug|iPhoneSimulator.ActiveCfg = Debug|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Debug|x64.ActiveCfg = Debug|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Debug|x64.Build.0 = Debug|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Debug|x86.ActiveCfg = Debug|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.MinSizeRel|ARM.ActiveCfg = MinSizeRel|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.MinSizeRel|iPhone.ActiveCfg = MinSizeRel|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.MinSizeRel|iPhoneSimulator.ActiveCfg = MinSizeRel|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Release|Any CPU.ActiveCfg = Release|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Release|ARM.ActiveCfg = Release|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Release|iPhone.ActiveCfg = Release|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Release|iPhoneSimulator.ActiveCfg = Release|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Release|x64.ActiveCfg = Release|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Release|x64.Build.0 = Release|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.Release|x86.ActiveCfg = Release|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {C7C69F12-F219-3414-8F95-58D1F5D29158}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Debug|Any CPU.ActiveCfg = Debug|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Debug|ARM.ActiveCfg = Debug|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Debug|iPhone.ActiveCfg = Debug|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Debug|iPhoneSimulator.ActiveCfg = Debug|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Debug|x64.ActiveCfg = Debug|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Debug|x64.Build.0 = Debug|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Debug|x86.ActiveCfg = Debug|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.MinSizeRel|ARM.ActiveCfg = MinSizeRel|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.MinSizeRel|iPhone.ActiveCfg = MinSizeRel|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.MinSizeRel|iPhoneSimulator.ActiveCfg = MinSizeRel|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Release|Any CPU.ActiveCfg = Release|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Release|ARM.ActiveCfg = Release|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Release|iPhone.ActiveCfg = Release|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Release|iPhoneSimulator.ActiveCfg = Release|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Release|x64.ActiveCfg = Release|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Release|x64.Build.0 = Release|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.Release|x86.ActiveCfg = Release|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {C14A2A2C-7CC6-3592-860B-A67089682AA5}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Debug|ARM.ActiveCfg = Debug|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Debug|iPhone.ActiveCfg = Debug|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Debug|iPhoneSimulator.ActiveCfg = Debug|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Debug|x64.ActiveCfg = Debug|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Debug|x86.ActiveCfg = Debug|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Debug|x86.Build.0 = Debug|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.MinSizeRel|ARM.ActiveCfg = MinSizeRel|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.MinSizeRel|iPhone.ActiveCfg = MinSizeRel|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.MinSizeRel|iPhoneSimulator.ActiveCfg = MinSizeRel|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.MinSizeRel|x64.ActiveCfg = MinSizeRel|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.MinSizeRel|x86.Build.0 = MinSizeRel|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Release|Any CPU.ActiveCfg = Release|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Release|ARM.ActiveCfg = Release|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Release|iPhone.ActiveCfg = Release|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Release|iPhoneSimulator.ActiveCfg = Release|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Release|x64.ActiveCfg = Release|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Release|x86.ActiveCfg = Release|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.Release|x86.Build.0 = Release|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Win32
+ {7E414A7A-DB48-3EBF-8F4D-0AB7FC2E8721}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Debug|ARM.ActiveCfg = Debug|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Debug|iPhone.ActiveCfg = Debug|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Debug|x64.ActiveCfg = Debug|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Debug|x86.ActiveCfg = Debug|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Debug|x86.Build.0 = Debug|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.MinSizeRel|ARM.ActiveCfg = MinSizeRel|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.MinSizeRel|iPhone.ActiveCfg = MinSizeRel|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.MinSizeRel|iPhoneSimulator.ActiveCfg = MinSizeRel|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.MinSizeRel|x64.ActiveCfg = MinSizeRel|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.MinSizeRel|x86.Build.0 = MinSizeRel|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Release|Any CPU.ActiveCfg = Release|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Release|ARM.ActiveCfg = Release|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Release|iPhone.ActiveCfg = Release|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Release|iPhoneSimulator.ActiveCfg = Release|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Release|x64.ActiveCfg = Release|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Release|x86.ActiveCfg = Release|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.Release|x86.Build.0 = Release|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Win32
+ {BC80B5C6-5AF4-30F4-803D-3844579C103B}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -708,10 +631,8 @@ Global
{C9753FE6-8022-427E-A612-D9E8EDB3641D} = {4FF9AAE6-210E-41F0-A5E1-8D7C4A864F51}
{A416D382-B243-4019-A05D-1D937F1CD73A} = {4FF9AAE6-210E-41F0-A5E1-8D7C4A864F51}
{D8DF24A7-E618-4A0F-ABC4-97AC823BD6A3} = {4FF9AAE6-210E-41F0-A5E1-8D7C4A864F51}
- {C7C69F12-F219-3414-8F95-58D1F5D29158} = {0AEA39B5-0D91-4334-81F9-9D45415FD36B}
- {C14A2A2C-7CC6-3592-860B-A67089682AA5} = {0AEA39B5-0D91-4334-81F9-9D45415FD36B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {DA9D266A-F38B-37CE-8E65-3C773727043C}
+ SolutionGuid = {BE5E0028-B74D-4BE1-B1DA-5FFCC8469C41}
EndGlobalSection
EndGlobal
diff --git a/Realm/AssemblyInfo.props b/Realm/AssemblyInfo.props
index b1ec1ca77a..014d732fbd 100644
--- a/Realm/AssemblyInfo.props
+++ b/Realm/AssemblyInfo.props
@@ -1,7 +1,7 @@
Realm .NET
- 5.1.1
+ 10.0.0
Realm is a mobile database: a replacement for SQLite
Realm Inc.
Copyright © $([System.DateTime]::Now.ToString(yyyy)) Realm Inc.
diff --git a/Realm/Realm.Fody/Extensions/PropertyDefinitionExtensions.cs b/Realm/Realm.Fody/Extensions/PropertyDefinitionExtensions.cs
index 145af01487..8b50bc7b9e 100644
--- a/Realm/Realm.Fody/Extensions/PropertyDefinitionExtensions.cs
+++ b/Realm/Realm.Fody/Extensions/PropertyDefinitionExtensions.cs
@@ -24,7 +24,7 @@
using System.Text.RegularExpressions;
using Mono.Cecil;
using Mono.Cecil.Cil;
-
+using RealmWeaver;
using static ModuleWeaver;
[EditorBrowsable(EditorBrowsableState.Never)]
@@ -94,6 +94,21 @@ internal static bool IsDouble(this PropertyDefinition property)
return property.PropertyType.FullName == DoubleTypeName;
}
+ internal static bool IsDecimal(this PropertyDefinition property)
+ {
+ return property.PropertyType.FullName == DecimalTypeName;
+ }
+
+ internal static bool IsDecimal128(this PropertyDefinition property)
+ {
+ return property.PropertyType.FullName == Decimal128TypeName;
+ }
+
+ internal static bool IsObjectId(this PropertyDefinition property)
+ {
+ return property.PropertyType.FullName == ObjectIdTypeName;
+ }
+
internal static bool IsString(this PropertyDefinition property)
{
return property.PropertyType.FullName == StringTypeName;
@@ -113,21 +128,21 @@ internal static FieldReference GetBackingField(this PropertyDefinition property)
.SingleOrDefault();
}
- internal static bool IsPrimaryKey(this PropertyDefinition property)
+ internal static bool IsPrimaryKey(this PropertyDefinition property, ImportedReferences references)
{
- Debug.Assert(property.DeclaringType.BaseType.Name == "RealmObject", "Primary key properties only make sense on RealmObject classes");
+ Debug.Assert(property.DeclaringType.IsValidRealmObjectBaseInheritor(references), "Primary key properties only make sense on RealmObject/EmbeddedObject classes");
return property.CustomAttributes.Any(a => a.AttributeType.Name == "PrimaryKeyAttribute");
}
- internal static bool IsRequired(this PropertyDefinition property)
+ internal static bool IsRequired(this PropertyDefinition property, ImportedReferences references)
{
- Debug.Assert(property.DeclaringType.BaseType.Name == "RealmObject", "Required properties only make sense on RealmObject classes");
+ Debug.Assert(property.DeclaringType.IsValidRealmObjectBaseInheritor(references), "Required properties only make sense on RealmObject/EmbeddedObject classes");
return property.CustomAttributes.Any(a => a.AttributeType.Name == "RequiredAttribute");
}
- internal static bool IsIndexable(this PropertyDefinition property)
+ internal static bool IsIndexable(this PropertyDefinition property, ImportedReferences references)
{
- Debug.Assert(property.DeclaringType.BaseType.Name == "RealmObject", "Required properties only make sense on RealmObject classes");
+ Debug.Assert(property.DeclaringType.IsValidRealmObjectBaseInheritor(references), "Required properties only make sense on RealmObject/EmbeddedObject classes");
var propertyType = property.PropertyType;
if (propertyType.IsRealmInteger(out var isNullable, out var backingType))
{
@@ -142,6 +157,16 @@ internal static bool IsIndexable(this PropertyDefinition property)
return _indexableTypes.Contains(propertyType.FullName);
}
+ public static bool IsEmbeddedObjectInheritor(this TypeDefinition type, ImportedReferences references) => type.BaseType.IsSameAs(references.EmbeddedObject);
+
+ public static bool IsRealmObjectInheritor(this TypeDefinition type, ImportedReferences references) => type.BaseType.IsSameAs(references.RealmObject);
+
+ public static bool IsValidRealmObjectBaseInheritor(this TypeDefinition type, ImportedReferences references) => type.IsEmbeddedObjectInheritor(references) || type.IsRealmObjectInheritor(references);
+
+ public static bool ContainsRealmObject(this PropertyDefinition property, ImportedReferences references) => property.PropertyType.Resolve().IsRealmObjectInheritor(references);
+
+ public static bool ContainsEmbeddedObject(this PropertyDefinition property, ImportedReferences references) => property.PropertyType.Resolve().IsEmbeddedObjectInheritor(references);
+
public static bool IsRealmInteger(this TypeReference type, out bool isNullable, out TypeReference genericArgumentType)
{
var nullableMatch = NullableRegex.Match(type.FullName);
diff --git a/Realm/Realm.Fody/ImportedReferences.cs b/Realm/Realm.Fody/ImportedReferences.cs
index dd55da0014..9bb15cf5b0 100644
--- a/Realm/Realm.Fody/ImportedReferences.cs
+++ b/Realm/Realm.Fody/ImportedReferences.cs
@@ -47,10 +47,6 @@ internal abstract class ImportedReferences
public MethodReference System_Type_GetTypeFromHandle { get; }
- public TypeReference System_DateTimeOffset { get; }
-
- public MethodReference System_DateTimeOffset_op_Inequality { get; private set; }
-
public abstract TypeReference System_Collections_Generic_ListOfT { get; }
public MethodReference System_Collections_Generic_ListOfT_Constructor { get; private set; }
@@ -81,6 +77,10 @@ internal abstract class ImportedReferences
public TypeReference RealmObject { get; private set; }
+ public TypeReference RealmObjectBase { get; private set; }
+
+ public TypeReference EmbeddedObject { get; private set; }
+
public TypeReference RealmIntegerOfT { get; private set; }
public MethodReference RealmIntegerOfT_ConvertToT { get; private set; }
@@ -101,6 +101,12 @@ internal abstract class ImportedReferences
public MethodReference RealmObject_GetBacklinks { get; private set; }
+ public MethodReference RealmObject_GetPrimitiveValue { get; private set; }
+
+ public MethodReference RealmObject_SetPrimitiveValue { get; private set; }
+
+ public MethodReference RealmObject_SetPrimitiveValueUnique { get; private set; }
+
public TypeReference IRealmObjectHelper { get; private set; }
public TypeReference PreserveAttribute { get; private set; }
@@ -129,6 +135,8 @@ internal abstract class ImportedReferences
public MethodReference RealmSchema_AddDefaultTypes { get; private set; }
+ public TypeReference RealmSchema_PropertyType { get; private set; }
+
protected ModuleDefinition Module { get; }
protected Fody.TypeSystem Types { get; }
@@ -184,8 +192,6 @@ protected ImportedReferences(ModuleDefinition module, Fody.TypeSystem types, Fra
Parameters = { new ParameterDefinition(runtimeTypeHandle) }
};
- System_DateTimeOffset = new TypeReference("System", "DateTimeOffset", Module, Module.TypeSystem.CoreLibrary, valueType: true);
-
// If the assembly has a reference to PropertyChanged.Fody, let's look up the DoNotNotifyAttribute for use later.
var PropertyChanged_Fody = Module.AssemblyReferences.SingleOrDefault(a => a.Name == "PropertyChanged");
if (PropertyChanged_Fody != null)
@@ -212,11 +218,6 @@ private void InitializeFrameworkMethods()
Parameters = { new ParameterDefinition(Types.Int32Reference) }
};
- System_DateTimeOffset_op_Inequality = new MethodReference("op_Inequality", Types.BooleanReference, System_DateTimeOffset)
- {
- Parameters = { new ParameterDefinition(System_DateTimeOffset), new ParameterDefinition(System_DateTimeOffset) }
- };
-
System_Collections_Generic_ListOfT_Constructor = new MethodReference(".ctor", Types.VoidReference, System_Collections_Generic_ListOfT) { HasThis = true };
{
@@ -238,7 +239,10 @@ private void InitializeFrameworkMethods()
private void InitializeRealm(IMetadataScope realmAssembly)
{
Realm = new TypeReference("Realms", "Realm", Module, realmAssembly);
+ RealmObjectBase = new TypeReference("Realms", "RealmObjectBase", Module, realmAssembly);
RealmObject = new TypeReference("Realms", "RealmObject", Module, realmAssembly);
+ EmbeddedObject = new TypeReference("Realms", "EmbeddedObject", Module, realmAssembly);
+ RealmSchema_PropertyType = new TypeReference("Realms.Schema", "PropertyType", Module, realmAssembly, valueType: true);
{
RealmIntegerOfT = new TypeReference("Realms", "RealmInteger`1", Module, realmAssembly)
@@ -271,32 +275,32 @@ private void InitializeRealm(IMetadataScope realmAssembly)
Realm_Add.Parameters.Add(new ParameterDefinition(Types.BooleanReference));
}
- RealmObject_get_IsManaged = new MethodReference("get_IsManaged", Types.BooleanReference, RealmObject) { HasThis = true };
- RealmObject_get_Realm = new MethodReference("get_Realm", Realm, RealmObject) { HasThis = true };
- RealmObject_RaisePropertyChanged = new MethodReference("RaisePropertyChanged", Types.VoidReference, RealmObject)
+ RealmObject_get_IsManaged = new MethodReference("get_IsManaged", Types.BooleanReference, RealmObjectBase) { HasThis = true };
+ RealmObject_get_Realm = new MethodReference("get_Realm", Realm, RealmObjectBase) { HasThis = true };
+ RealmObject_RaisePropertyChanged = new MethodReference("RaisePropertyChanged", Types.VoidReference, RealmObjectBase)
{
HasThis = true,
Parameters = { new ParameterDefinition(Types.StringReference) }
};
{
- RealmObject_GetObjectValue = new MethodReference("GetObjectValue", Types.VoidReference, RealmObject) { HasThis = true };
- var T = new GenericParameter(RealmObject_GetObjectValue) { Constraints = { new GenericParameterConstraint(RealmObject) } };
+ RealmObject_GetObjectValue = new MethodReference("GetObjectValue", Types.VoidReference, RealmObjectBase) { HasThis = true };
+ var T = new GenericParameter(RealmObject_GetObjectValue) { Constraints = { new GenericParameterConstraint(RealmObjectBase) } };
RealmObject_GetObjectValue.ReturnType = T;
RealmObject_GetObjectValue.GenericParameters.Add(T);
RealmObject_GetObjectValue.Parameters.Add(new ParameterDefinition(Types.StringReference));
}
{
- RealmObject_SetObjectValue = new MethodReference("SetObjectValue", Types.VoidReference, RealmObject) { HasThis = true };
- var T = new GenericParameter(RealmObject_SetObjectValue) { Constraints = { new GenericParameterConstraint(RealmObject) } };
+ RealmObject_SetObjectValue = new MethodReference("SetObjectValue", Types.VoidReference, RealmObjectBase) { HasThis = true };
+ var T = new GenericParameter(RealmObject_SetObjectValue) { Constraints = { new GenericParameterConstraint(RealmObjectBase) } };
RealmObject_SetObjectValue.GenericParameters.Add(T);
RealmObject_SetObjectValue.Parameters.Add(new ParameterDefinition(Types.StringReference));
RealmObject_SetObjectValue.Parameters.Add(new ParameterDefinition(T));
}
{
- RealmObject_GetListValue = new MethodReference("GetListValue", new GenericInstanceType(IListOfT), RealmObject) { HasThis = true };
+ RealmObject_GetListValue = new MethodReference("GetListValue", new GenericInstanceType(IListOfT), RealmObjectBase) { HasThis = true };
var T = new GenericParameter(RealmObject_GetListValue);
(RealmObject_GetListValue.ReturnType as GenericInstanceType).GenericArguments.Add(T);
RealmObject_GetListValue.GenericParameters.Add(T);
@@ -304,13 +308,40 @@ private void InitializeRealm(IMetadataScope realmAssembly)
}
{
- RealmObject_GetBacklinks = new MethodReference("GetBacklinks", new GenericInstanceType(IQueryableOfT), RealmObject) { HasThis = true };
- var T = new GenericParameter(RealmObject_GetBacklinks) { Constraints = { new GenericParameterConstraint(RealmObject) } };
+ RealmObject_GetBacklinks = new MethodReference("GetBacklinks", new GenericInstanceType(IQueryableOfT), RealmObjectBase) { HasThis = true };
+ var T = new GenericParameter(RealmObject_GetBacklinks) { Constraints = { new GenericParameterConstraint(RealmObjectBase) } };
(RealmObject_GetBacklinks.ReturnType as GenericInstanceType).GenericArguments.Add(T);
RealmObject_GetBacklinks.GenericParameters.Add(T);
RealmObject_GetBacklinks.Parameters.Add(new ParameterDefinition(Types.StringReference));
}
+ {
+ RealmObject_GetPrimitiveValue = new MethodReference("GetPrimitiveValue", Types.VoidReference, RealmObjectBase) { HasThis = true };
+ var T = new GenericParameter(RealmObject_GetPrimitiveValue);
+ RealmObject_GetPrimitiveValue.ReturnType = T;
+ RealmObject_GetPrimitiveValue.GenericParameters.Add(T);
+ RealmObject_GetPrimitiveValue.Parameters.Add(new ParameterDefinition(Types.StringReference));
+ RealmObject_GetPrimitiveValue.Parameters.Add(new ParameterDefinition(RealmSchema_PropertyType));
+ }
+
+ {
+ RealmObject_SetPrimitiveValue = new MethodReference("SetPrimitiveValue", Types.VoidReference, RealmObjectBase) { HasThis = true };
+ var T = new GenericParameter(RealmObject_SetPrimitiveValue);
+ RealmObject_SetPrimitiveValue.GenericParameters.Add(T);
+ RealmObject_SetPrimitiveValue.Parameters.Add(new ParameterDefinition(Types.StringReference));
+ RealmObject_SetPrimitiveValue.Parameters.Add(new ParameterDefinition(T));
+ RealmObject_SetPrimitiveValue.Parameters.Add(new ParameterDefinition(RealmSchema_PropertyType));
+ }
+
+ {
+ RealmObject_SetPrimitiveValueUnique = new MethodReference("SetPrimitiveValueUnique", Types.VoidReference, RealmObjectBase) { HasThis = true };
+ var T = new GenericParameter(RealmObject_SetPrimitiveValueUnique);
+ RealmObject_SetPrimitiveValueUnique.GenericParameters.Add(T);
+ RealmObject_SetPrimitiveValueUnique.Parameters.Add(new ParameterDefinition(Types.StringReference));
+ RealmObject_SetPrimitiveValueUnique.Parameters.Add(new ParameterDefinition(T));
+ RealmObject_SetPrimitiveValueUnique.Parameters.Add(new ParameterDefinition(RealmSchema_PropertyType));
+ }
+
IRealmObjectHelper = new TypeReference("Realms.Weaving", "IRealmObjectHelper", Module, realmAssembly);
PreserveAttribute = new TypeReference("Realms", "PreserveAttribute", Module, realmAssembly);
@@ -373,6 +404,11 @@ protected AssemblyNameReference GetOrAddFrameworkReference(string assemblyName)
return assembly;
}
+ public FieldReference GetPropertyTypeField(string name)
+ {
+ return new FieldReference(name, RealmSchema_PropertyType, RealmSchema_PropertyType);
+ }
+
public GenericParameter GetRealmIntegerGenericParameter(IGenericParameterProvider owner)
{
var T = new GenericParameter(owner)
diff --git a/Realm/Realm.Fody/ModuleWeaver.cs b/Realm/Realm.Fody/ModuleWeaver.cs
index 28379cdbdb..6136511fcf 100644
--- a/Realm/Realm.Fody/ModuleWeaver.cs
+++ b/Realm/Realm.Fody/ModuleWeaver.cs
@@ -40,6 +40,9 @@ public partial class ModuleWeaver : Fody.BaseModuleWeaver
internal const string SingleTypeName = "System.Single";
internal const string DoubleTypeName = "System.Double";
internal const string BooleanTypeName = "System.Boolean";
+ internal const string DecimalTypeName = "System.Decimal";
+ internal const string Decimal128TypeName = "MongoDB.Bson.Decimal128";
+ internal const string ObjectIdTypeName = "MongoDB.Bson.ObjectId";
internal const string DateTimeOffsetTypeName = "System.DateTimeOffset";
internal const string NullableCharTypeName = "System.Nullable`1";
internal const string NullableByteTypeName = "System.Nullable`1";
@@ -49,22 +52,35 @@ public partial class ModuleWeaver : Fody.BaseModuleWeaver
internal const string NullableSingleTypeName = "System.Nullable`1";
internal const string NullableDoubleTypeName = "System.Nullable`1";
internal const string NullableBooleanTypeName = "System.Nullable`1";
+ internal const string NullableDecimalTypeName = "System.Nullable`1";
+ internal const string NullableDecimal128TypeName = "System.Nullable`1";
internal const string NullableDateTimeOffsetTypeName = "System.Nullable`1";
+ internal const string NullableObjectIdTypeName = "System.Nullable`1";
private static readonly Dictionary _typeTable = new Dictionary
{
{ StringTypeName, "String" },
- { CharTypeName, "Char" },
- { SingleTypeName, "Single" },
- { DoubleTypeName, "Double" },
- { BooleanTypeName, "Boolean" },
- { DateTimeOffsetTypeName, "DateTimeOffset" },
{ ByteArrayTypeName, "ByteArray" },
- { NullableCharTypeName, "NullableChar" },
- { NullableSingleTypeName, "NullableSingle" },
+ };
+
+ private static readonly Dictionary _primitiveValueTypes = new Dictionary
+ {
+ { CharTypeName, "Int" },
+ { SingleTypeName, "Float" },
+ { DoubleTypeName, "Double" },
+ { BooleanTypeName, "Bool" },
+ { DecimalTypeName, "Decimal" },
+ { Decimal128TypeName, "Decimal" },
+ { ObjectIdTypeName, "ObjectId" },
+ { DateTimeOffsetTypeName, "Date" },
+ { NullableCharTypeName, "NullableInt" },
+ { NullableSingleTypeName, "NullableFloat" },
{ NullableDoubleTypeName, "NullableDouble" },
- { NullableBooleanTypeName, "NullableBoolean" },
- { NullableDateTimeOffsetTypeName, "NullableDateTimeOffset" }
+ { NullableBooleanTypeName, "NullableBool" },
+ { NullableDateTimeOffsetTypeName, "NullableDate" },
+ { NullableDecimalTypeName, "NullableDecimal" },
+ { NullableDecimal128TypeName, "NullableDecimal" },
+ { NullableObjectIdTypeName, "NullableObjectId" },
};
private static readonly IEnumerable _realmIntegerBackedTypes = new[]
@@ -95,11 +111,13 @@ public partial class ModuleWeaver : Fody.BaseModuleWeaver
Int16TypeName,
Int32TypeName,
Int64TypeName,
+ ObjectIdTypeName,
NullableCharTypeName,
NullableByteTypeName,
NullableInt16TypeName,
NullableInt32TypeName,
NullableInt64TypeName,
+ NullableObjectIdTypeName,
};
private static readonly HashSet RealmPropertyAttributes = new HashSet
@@ -113,13 +131,13 @@ public partial class ModuleWeaver : Fody.BaseModuleWeaver
private IEnumerable GetMatchingTypes()
{
- foreach (var type in ModuleDefinition.GetTypes().Where(t => t.IsDescendedFrom(_references.RealmObject)))
+ foreach (var type in ModuleDefinition.GetTypes().Where(t => t.IsDescendedFrom(_references.RealmObject) || t.IsDescendedFrom(_references.EmbeddedObject)))
{
if (type.CustomAttributes.Any(a => a.AttributeType.Name == "IgnoredAttribute"))
{
continue;
}
- else if (type.BaseType.IsSameAs(_references.RealmObject))
+ else if (type.IsValidRealmObjectBaseInheritor(_references))
{
yield return type;
}
@@ -256,6 +274,13 @@ private void WeaveType(TypeDefinition type, Dictionary method
return;
}
+ var pkProperty = persistedProperties.FirstOrDefault(p => p.IsPrimaryKey);
+ if (type.IsEmbeddedObjectInheritor(_references) && pkProperty != null)
+ {
+ WriteError($"Class {type.Name} is an EmbeddedObject but has a primary key {pkProperty.Property.Name} defined.");
+ return;
+ }
+
if (persistedProperties.Count(p => p.IsPrimaryKey) > 1)
{
WriteError($"Class {type.Name} has more than one property marked with [PrimaryKey].");
@@ -297,18 +322,18 @@ private WeaveResult WeaveProperty(PropertyDefinition prop, TypeDefinition type,
var backingField = prop.GetBackingField();
var isIndexed = prop.CustomAttributes.Any(a => a.AttributeType.Name == "IndexedAttribute");
- if (isIndexed && !prop.IsIndexable())
+ if (isIndexed && !prop.IsIndexable(_references))
{
return WeaveResult.Error($"{type.Name}.{prop.Name} is marked as [Indexed] which is only allowed on integral types as well as string, bool and DateTimeOffset, not on {prop.PropertyType.FullName}.");
}
- var isPrimaryKey = prop.IsPrimaryKey();
+ var isPrimaryKey = prop.IsPrimaryKey(_references);
if (isPrimaryKey && (!_primaryKeyTypes.Contains(prop.PropertyType.FullName)))
{
return WeaveResult.Error($"{type.Name}.{prop.Name} is marked as [PrimaryKey] which is only allowed on integral and string types, not on {prop.PropertyType.FullName}.");
}
- var isRequired = prop.IsRequired();
+ var isRequired = prop.IsRequired(_references);
if (isRequired &&
!prop.IsIList(typeof(string)) &&
!prop.IsNullable() &&
@@ -320,9 +345,9 @@ private WeaveResult WeaveProperty(PropertyDefinition prop, TypeDefinition type,
if (!prop.IsAutomatic())
{
- if (prop.PropertyType.Resolve().BaseType.IsSameAs(_references.RealmObject))
+ if (prop.ContainsRealmObject(_references) || prop.ContainsEmbeddedObject(_references))
{
- return WeaveResult.Warning($"{type.Name}.{prop.Name} is not an automatic property but its type is a RealmObject which normally indicates a relationship.");
+ return WeaveResult.Warning($"{type.Name}.{prop.Name} is not an automatic property but its type is a RealmObject/EmbeddedObject which normally indicates a relationship.");
}
return WeaveResult.Skipped();
@@ -347,6 +372,30 @@ private WeaveResult WeaveProperty(PropertyDefinition prop, TypeDefinition type,
ReplaceGetter(prop, columnName, realmAccessors.Getter);
ReplaceSetter(prop, backingField, columnName, realmAccessors.Setter);
}
+ else if (_primitiveValueTypes.TryGetValue(prop.PropertyType.FullName, out var propertyType))
+ {
+ if (prop.SetMethod == null)
+ {
+ return WeaveResult.Skipped();
+ }
+
+ var suffix = isPrimaryKey ? "Unique" : string.Empty;
+ var typeId = $"{prop.PropertyType.FullName}{suffix}";
+
+ if (!methodTable.TryGetValue(typeId, out var accessors))
+ {
+ var getter = new GenericInstanceMethod(_references.RealmObject_GetPrimitiveValue) { GenericArguments = { prop.PropertyType } };
+ var setter = new GenericInstanceMethod(isPrimaryKey ? _references.RealmObject_SetPrimitiveValueUnique : _references.RealmObject_SetPrimitiveValue)
+ {
+ GenericArguments = { prop.PropertyType }
+ };
+ methodTable[typeId] = accessors = new Accessors { Getter = getter, Setter = setter };
+ }
+
+ var propertyTypeRef = _references.GetPropertyTypeField(propertyType);
+ ReplaceGetter(prop, columnName, accessors.Getter, propertyTypeRef);
+ ReplaceSetter(prop, backingField, columnName, accessors.Setter, propertyTypeRef);
+ }
else if (_realmIntegerBackedTypes.Contains(prop.PropertyType.FullName))
{
// If the property is automatic but doesn't have a setter, we should still ignore it.
@@ -375,7 +424,7 @@ private WeaveResult WeaveProperty(PropertyDefinition prop, TypeDefinition type,
var typeId = $"{prefix}{integerType.FullName}{suffix}";
if (!methodTable.TryGetValue(typeId, out var accessors))
{
- var genericGetter = new MethodReference($"Get{prefix}RealmIntegerValue", ModuleDefinition.TypeSystem.Void, _references.RealmObject)
+ var genericGetter = new MethodReference($"Get{prefix}RealmIntegerValue", ModuleDefinition.TypeSystem.Void, _references.RealmObjectBase)
{
HasThis = true,
Parameters = { new ParameterDefinition(ModuleDefinition.TypeSystem.String) }
@@ -392,7 +441,7 @@ private WeaveResult WeaveProperty(PropertyDefinition prop, TypeDefinition type,
genericGetter.ReturnType = returnType;
- var genericSetter = new MethodReference($"Set{prefix}RealmIntegerValue{suffix}", ModuleDefinition.TypeSystem.Void, _references.RealmObject)
+ var genericSetter = new MethodReference($"Set{prefix}RealmIntegerValue{suffix}", ModuleDefinition.TypeSystem.Void, _references.RealmObjectBase)
{
HasThis = true,
Parameters =
@@ -423,9 +472,10 @@ private WeaveResult WeaveProperty(PropertyDefinition prop, TypeDefinition type,
else if (prop.IsIList())
{
var elementType = ((GenericInstanceType)prop.PropertyType).GenericArguments.Single();
- if (!elementType.Resolve().BaseType.IsSameAs(_references.RealmObject) &&
+ if (!elementType.Resolve().IsValidRealmObjectBaseInheritor(_references) &&
!_realmIntegerBackedTypes.Contains(elementType.FullName) &&
- !_typeTable.ContainsKey(elementType.FullName))
+ !_typeTable.ContainsKey(elementType.FullName) &&
+ !_primitiveValueTypes.ContainsKey(elementType.FullName))
{
return WeaveResult.Error($"{type.Name}.{prop.Name} is an IList but its generic type is {elementType.Name} which is not supported by Realm.");
}
@@ -447,7 +497,7 @@ private WeaveResult WeaveProperty(PropertyDefinition prop, TypeDefinition type,
new GenericInstanceMethod(_references.RealmObject_GetListValue) { GenericArguments = { elementType } },
concreteListConstructor);
}
- else if (prop.PropertyType.Resolve().BaseType.IsSameAs(_references.RealmObject))
+ else if (prop.ContainsRealmObject(_references) || prop.ContainsEmbeddedObject(_references))
{
// with casting in the _realmObject methods, should just work
ReplaceGetter(prop, columnName,
@@ -526,12 +576,13 @@ private Accessors GetAccessors(TypeReference backingType, bool isPrimaryKey, IDi
if (!methodTable.TryGetValue(typeId, out var realmAccessors))
{
- var getter = new MethodReference($"Get{typeName}Value", backingType, _references.RealmObject)
+ var getter = new MethodReference($"Get{typeName}Value", backingType, _references.RealmObjectBase)
{
HasThis = true,
- Parameters = { new ParameterDefinition(ModuleDefinition.TypeSystem.String) }
+ Parameters = { new ParameterDefinition(ModuleDefinition.TypeSystem.String) },
};
- var setter = new MethodReference($"Set{typeName}Value" + (isPrimaryKey ? "Unique" : string.Empty), ModuleDefinition.TypeSystem.Void, _references.RealmObject)
+
+ var setter = new MethodReference($"Set{typeName}Value" + (isPrimaryKey ? "Unique" : string.Empty), ModuleDefinition.TypeSystem.Void, _references.RealmObjectBase)
{
HasThis = true,
Parameters =
@@ -547,7 +598,7 @@ private Accessors GetAccessors(TypeReference backingType, bool isPrimaryKey, IDi
return realmAccessors;
}
- private void ReplaceGetter(PropertyDefinition prop, string columnName, MethodReference getValueReference)
+ private void ReplaceGetter(PropertyDefinition prop, string columnName, MethodReference getValueReference, FieldReference propertyTypeRef = null)
{
//// A synthesized property getter looks like this:
//// 0: ldarg.0
@@ -576,6 +627,11 @@ private void ReplaceGetter(PropertyDefinition prop, string columnName, MethodRef
il.InsertBefore(start, il.Create(OpCodes.Brfalse_S, start));
il.InsertBefore(start, il.Create(OpCodes.Ldarg_0)); // this for call
il.InsertBefore(start, il.Create(OpCodes.Ldstr, columnName)); // [stack = this | name ]
+ if (propertyTypeRef != null)
+ {
+ il.InsertBefore(start, il.Create(OpCodes.Ldc_I4, (int)(byte)propertyTypeRef.Resolve().Constant));
+ }
+
il.InsertBefore(start, il.Create(OpCodes.Call, getValueReference));
il.InsertBefore(start, il.Create(OpCodes.Ret));
@@ -767,7 +823,7 @@ private void ReplaceBacklinksGetter(PropertyDefinition prop, FieldReference back
Debug.Write("[get list] ");
}
- private void ReplaceSetter(PropertyDefinition prop, FieldReference backingField, string columnName, MethodReference setValueReference)
+ private void ReplaceSetter(PropertyDefinition prop, FieldReference backingField, string columnName, MethodReference setValueReference, FieldReference propertyTypeRef = null)
{
//// A synthesized property setter looks like this:
//// 0: ldarg.0
@@ -829,6 +885,11 @@ private void ReplaceSetter(PropertyDefinition prop, FieldReference backingField,
il.Append(managedSetStart);
il.Append(il.Create(OpCodes.Ldstr, columnName));
il.Append(il.Create(OpCodes.Ldarg_1));
+ if (propertyTypeRef != null)
+ {
+ il.Append(il.Create(OpCodes.Ldc_I4, (int)(byte)propertyTypeRef.Resolve().Constant));
+ }
+
il.Append(il.Create(OpCodes.Call, setValueReference));
il.Append(il.Create(OpCodes.Ret));
@@ -926,7 +987,7 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
helperType.Interfaces.Add(new InterfaceImplementation(_references.IRealmObjectHelper));
- var createInstance = new MethodDefinition("CreateInstance", DefaultMethodAttributes, _references.RealmObject);
+ var createInstance = new MethodDefinition("CreateInstance", DefaultMethodAttributes, _references.RealmObjectBase);
{
var il = createInstance.Body.GetILProcessor();
il.Emit(OpCodes.Newobj, objectConstructor);
@@ -972,7 +1033,7 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
}
*/
- var instanceParameter = new ParameterDefinition("instance", ParameterAttributes.None, _references.RealmObject);
+ var instanceParameter = new ParameterDefinition("instance", ParameterAttributes.None, _references.RealmObjectBase);
copyToRealm.Parameters.Add(instanceParameter);
var updateParameter = new ParameterDefinition("update", ParameterAttributes.None, ModuleDefinition.TypeSystem.Boolean);
@@ -984,11 +1045,6 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
copyToRealm.Body.Variables.Add(new VariableDefinition(realmObjectType));
byte currentStloc = 1;
- if (properties.Any(p => p.Property.IsDateTimeOffset()))
- {
- copyToRealm.Body.Variables.Add(new VariableDefinition(_references.System_DateTimeOffset));
- currentStloc++;
- }
foreach (var prop in properties.Where(p => p.Property.IsIList()))
{
@@ -1001,7 +1057,7 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
il.Append(il.Create(OpCodes.Castclass, ModuleDefinition.ImportReference(realmObjectType)));
il.Append(il.Create(OpCodes.Stloc_0));
- foreach (var prop in properties.Where(p => !p.Property.IsPrimaryKey()))
+ foreach (var prop in properties.Where(p => !p.Property.IsPrimaryKey(_references)))
{
var property = prop.Property;
var field = prop.Field;
@@ -1020,9 +1076,12 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
// We can skip setting properties that have their default values unless:
var shouldSetAlways = property.IsNullable() || // The property is nullable - those should be set explicitly to null
- property.IsRequired() || // Needed for validating that the property is not null (string)
+ property.IsRequired(_references) || // Needed for validating that the property is not null (string)
property.IsDateTimeOffset() || // Core's DateTimeOffset property defaults to 1970-1-1, so we should override
- property.PropertyType.IsRealmInteger(out _, out _); // structs are not implicitly falsy/truthy so the IL is significantly different; we can optimize this case in the future
+ property.PropertyType.IsRealmInteger(out _, out _) || // structs are not implicitly falsy/truthy so the IL is significantly different; we can optimize this case in the future
+ property.IsDecimal() ||
+ property.IsDecimal128() ||
+ property.IsObjectId();
// If the property is non-nullable, we want the following code to execute:
// if (!skipDefaults || castInstance.field != default(fieldType))
@@ -1034,7 +1093,7 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
// property setting logic. The default check branching instruction is inserted above the *setStartPoint*
// instruction later on.
Instruction skipDefaultsPlaceholder = null;
- if (property.IsDescendantOf(_references.RealmObject))
+ if (property.ContainsRealmObject(_references))
{
il.Append(il.Create(OpCodes.Ldloc_0));
il.Append(il.Create(OpCodes.Ldfld, field));
@@ -1078,7 +1137,7 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
var setEndPoint = il.Create(OpCodes.Nop);
il.Append(setEndPoint);
- if (property.IsDescendantOf(_references.RealmObject))
+ if (property.ContainsRealmObject(_references))
{
if (addPlaceholder != null)
{
@@ -1154,7 +1213,7 @@ private TypeDefinition WeaveRealmObjectHelper(TypeDefinition realmObjectType, Me
var cycleStart = il.Create(OpCodes.Ldloc_0);
il.Append(cycleStart);
- if (elementType.Resolve().BaseType.IsSameAs(_references.RealmObject))
+ if (elementType.Resolve().IsRealmObjectInheritor(_references))
{
// castInstance.Realm.Add(list[i], update)
il.Append(il.Create(OpCodes.Call, _references.RealmObject_get_Realm));
diff --git a/Realm/Realm/Configurations/FullSyncConfiguration.cs b/Realm/Realm/Configurations/FullSyncConfiguration.cs
deleted file mode 100644
index 2b70e74335..0000000000
--- a/Realm/Realm/Configurations/FullSyncConfiguration.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2018 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-
-namespace Realms.Sync
-{
- ///
- /// A is used to setup a that can be synchronized
- /// in "full" mode between devices using the Realm Object Server. The entirety of the Realm will be kept
- /// in sync between the server and the client.
- ///
- ///
- /// Full Synchronization docs.
- ///
- ///
- public class FullSyncConfiguration : SyncConfigurationBase
- {
- internal override bool IsFullSync => true;
-
- internal override ClientResyncMode ResyncMode => ClientResyncMode;
-
- ///
- /// Gets or sets a value controlling the behavior in case of a Client Resync. Default is .
- ///
- public ClientResyncMode ClientResyncMode { get; set; } = ClientResyncMode.RecoverLocalRealm;
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// A unique that identifies the Realm. In URIs, ~ can be used as a placeholder for a user Id.
- /// If a relative Uri is provided, it will be resolved using the user's as baseUri.
- ///
- ///
- /// A valid . If not provided, the currently logged-in user will be used.
- ///
- ///
- /// Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename.
- ///
- public FullSyncConfiguration(Uri serverUri, User user = null, string optionalPath = null)
- : base(serverUri, user, optionalPath)
- {
- }
- }
-}
diff --git a/Realm/Realm/Configurations/QueryBasedSyncConfiguration.cs b/Realm/Realm/Configurations/QueryBasedSyncConfiguration.cs
deleted file mode 100644
index d716e0f52c..0000000000
--- a/Realm/Realm/Configurations/QueryBasedSyncConfiguration.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2018 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Realms.Schema;
-
-namespace Realms.Sync
-{
- ///
- /// A is used to setup a that can be synchronized
- /// in "query-based" mode between devices using the Realm Object Server. Only objects that match the subscribed
- /// queries will be synchronized to the client.
- ///
- ///
- /// Query-based Synchronization docs.
- ///
- ///
- ///
- public class QueryBasedSyncConfiguration : SyncConfigurationBase
- {
- internal override bool IsFullSync => false;
-
- internal override ClientResyncMode ResyncMode => ClientResyncMode.Manual;
-
- internal static readonly Type[] _queryBasedPermissionTypes =
- {
- typeof(ClassPermission),
- typeof(Permission),
- typeof(PermissionRole),
- typeof(PermissionUser),
- typeof(RealmPermission),
- typeof(NamedSubscription)
- };
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// A unique that identifies the Realm. In URIs, ~ can be used as a placeholder for a user Id.
- /// If a relative Uri is provided, it will be resolved using the user's as baseUri.
- /// If null is passed, a Uri will be constructed from the user's , combined with
- /// /default .
- ///
- ///
- /// A valid . If not provided, the currently logged-in user will be used.
- ///
- ///
- /// Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename.
- ///
- public QueryBasedSyncConfiguration(Uri serverUri = null, User user = null, string optionalPath = null)
- : base(serverUri ?? new Uri("/default", UriKind.Relative), user, optionalPath)
- {
- }
-
- internal override Task CreateRealmAsync(RealmSchema schema, CancellationToken cancellationToken)
- {
- schema = RealmSchema.CreateSchemaForClasses(_queryBasedPermissionTypes, schema);
- return base.CreateRealmAsync(schema, cancellationToken);
- }
-
- internal override Realm CreateRealm(RealmSchema schema)
- {
- schema = RealmSchema.CreateSchemaForClasses(_queryBasedPermissionTypes, schema);
- return base.CreateRealm(schema);
- }
- }
-}
diff --git a/Realm/Realm/Configurations/RealmConfigurationBase.cs b/Realm/Realm/Configurations/RealmConfigurationBase.cs
index 119b5bef3c..92207532bf 100644
--- a/Realm/Realm/Configurations/RealmConfigurationBase.cs
+++ b/Realm/Realm/Configurations/RealmConfigurationBase.cs
@@ -57,7 +57,7 @@ public abstract class RealmConfigurationBase
/// Gets or sets the list of classes persisted in a Realm opened with this configuration.
///
///
- /// Typically left null so by default all s will be able to be stored in all Realms.
+ /// Typically left null so by default all s and s will be able to be stored in all Realms.
///
///
///
diff --git a/Realm/Realm/Configurations/SyncConfiguration.cs b/Realm/Realm/Configurations/SyncConfiguration.cs
new file mode 100644
index 0000000000..52eabc2d98
--- /dev/null
+++ b/Realm/Realm/Configurations/SyncConfiguration.cs
@@ -0,0 +1,199 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2018 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Threading;
+using System.Threading.Tasks;
+using MongoDB.Bson;
+using Realms.Helpers;
+using Realms.Schema;
+
+namespace Realms.Sync
+{
+ ///
+ /// A is used to setup a that can be synchronized between devices using MongoDB Realm.
+ ///
+ ///
+ public class SyncConfiguration : RealmConfigurationBase
+ {
+ ///
+ /// Gets the used to create this .
+ ///
+ /// The whose s will be synced.
+ public User User { get; }
+
+ ///
+ /// Gets or sets a callback that is invoked when download progress is made when using .
+ /// This will only be invoked for the initial download of the Realm and will not be invoked as futher download
+ /// progress is made during the lifetime of the Realm. It is ignored when using
+ /// .
+ ///
+ public Action OnProgress { get; set; }
+
+ ///
+ /// Gets the partition identifying the Realm this configuration is describing.
+ ///
+ /// The partition value for the Realm.
+ public object Partition { get; }
+
+ internal SessionStopPolicy SessionStopPolicy { get; set; } = SessionStopPolicy.AfterChangesUploaded;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The partition identifying the remote Realm that will be synchronized.
+ ///
+ ///
+ /// A valid . If not provided, the currently logged-in user will be used.
+ ///
+ ///
+ /// Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename.
+ ///
+ [SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Arguments are validated in the private ctor.")]
+ public SyncConfiguration(string partition, User user, string optionalPath = null)
+ : this((object)partition, user, optionalPath)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The partition identifying the remote Realm that will be synchronized.
+ ///
+ ///
+ /// A valid . If not provided, the currently logged-in user will be used.
+ ///
+ ///
+ /// Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename.
+ ///
+ [SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Arguments are validated in the private ctor.")]
+ public SyncConfiguration(long? partition, User user, string optionalPath = null)
+ : this((object)partition, user, optionalPath)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The partition identifying the remote Realm that will be synchronized.
+ ///
+ ///
+ /// A valid . If not provided, the currently logged-in user will be used.
+ ///
+ ///
+ /// Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename.
+ ///
+ [SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Arguments are validated in the private ctor.")]
+ public SyncConfiguration(ObjectId? partition, User user, string optionalPath = null)
+ : this((object)partition, user, optionalPath)
+ {
+ }
+
+ private SyncConfiguration(object partition, User user, string path)
+ {
+ Argument.NotNull(user, nameof(user));
+
+ User = user;
+ Partition = partition;
+ DatabasePath = GetPathToRealm(path ?? user.App.Handle.GetRealmPath(User, partition.ToNativeJson()));
+ }
+
+ internal override Realm CreateRealm(RealmSchema schema)
+ {
+ var configuration = CreateConfiguration();
+
+ var srHandle = SharedRealmHandle.OpenWithSync(configuration, ToNative(), schema, EncryptionKey);
+ if (IsDynamic && !schema.Any())
+ {
+ srHandle.GetSchema(nativeSchema => schema = RealmSchema.CreateFromObjectStoreSchema(nativeSchema));
+ }
+
+ return new Realm(srHandle, this, schema);
+ }
+
+ [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The Realm instance will own its handle")]
+ internal override async Task CreateRealmAsync(RealmSchema schema, CancellationToken cancellationToken)
+ {
+ var configuration = CreateConfiguration();
+
+ var tcs = new TaskCompletionSource();
+ var tcsHandle = GCHandle.Alloc(tcs);
+ ProgressNotificationToken progressToken = null;
+ try
+ {
+ using var handle = SharedRealmHandle.OpenWithSyncAsync(configuration, ToNative(), schema, EncryptionKey, tcsHandle);
+ cancellationToken.Register(() =>
+ {
+ if (!handle.IsClosed)
+ {
+ handle.Cancel();
+ tcs.TrySetCanceled();
+ }
+ });
+
+ if (OnProgress != null)
+ {
+ progressToken = new ProgressNotificationToken(
+ observer: (progress) =>
+ {
+ OnProgress(progress);
+ },
+ register: handle.RegisterProgressNotifier,
+ unregister: (token) =>
+ {
+ if (!handle.IsClosed)
+ {
+ handle.UnregisterProgressNotifier(token);
+ }
+ });
+ }
+
+ using var realmReference = await tcs.Task;
+ var realmPtr = SharedRealmHandle.ResolveFromReference(realmReference);
+ var sharedRealmHandle = new SharedRealmHandle(realmPtr);
+ if (IsDynamic && !schema.Any())
+ {
+ sharedRealmHandle.GetSchema(nativeSchema => schema = RealmSchema.CreateFromObjectStoreSchema(nativeSchema));
+ }
+
+ return new Realm(sharedRealmHandle, this, schema);
+ }
+ finally
+ {
+ tcsHandle.Free();
+ progressToken?.Dispose();
+ }
+ }
+
+ internal Native.SyncConfiguration ToNative()
+ {
+ return new Native.SyncConfiguration
+ {
+ SyncUserHandle = User.Handle,
+ Partition = Partition.ToNativeJson(),
+ session_stop_policy = SessionStopPolicy,
+ };
+ }
+ }
+}
diff --git a/Realm/Realm/Configurations/SyncConfigurationBase.cs b/Realm/Realm/Configurations/SyncConfigurationBase.cs
deleted file mode 100644
index 07b63d1cd7..0000000000
--- a/Realm/Realm/Configurations/SyncConfigurationBase.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2018 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.Threading.Tasks;
-using Realms.Helpers;
-using Realms.Schema;
-
-namespace Realms.Sync
-{
- ///
- /// A is used to setup a that can be synchronized between devices using the
- /// Realm Object Server.
- ///
- ///
- ///
- ///
- ///
- public abstract class SyncConfigurationBase : RealmConfigurationBase
- {
- internal abstract bool IsFullSync { get; }
-
- ///
- /// Gets the used to create this .
- ///
- /// The where the Realm Object Server is hosted.
- public Uri ServerUri { get; }
-
- ///
- /// Gets the used to create this .
- ///
- /// The whose s will be synced.
- public User User { get; }
-
- ///
- /// Gets or sets a value indicating whether SSL certificate validation is enabled for the connection associated
- /// with this configuration value.
- ///
- /// true if SSL validation is enabled; otherwise, false . Default value is true .
- public bool EnableSSLValidation { get; set; } = true;
-
- ///
- /// Gets or sets the path to the trusted root certificate(s) authority (CA) in PEM format, that should
- /// be used to validate the TLS connections to the Realm Object Server.
- ///
- /// The path to the certificate.
- ///
- /// The file will be copied at runtime into the internal storage.
- ///
- /// It is recommended to include only the root CA you trust, and not the entire list of root CA as this file
- /// will be loaded at runtime. It is your responsibility to download and verify the correct PEM for the root CA
- /// you trust.
- ///
- /// This property is ignored on Apple platforms - you should use the KeyChain API to install your certificate
- /// instead.
- ///
- ///
- /// OpenSSL documentation for SSL_CTX_load_verify_locations.
- ///
- ///
- /// Mozilla Included CA Certificate List
- ///
- public string TrustedCAPath { get; set; }
-
- ///
- /// Gets or sets a callback that is invoked when download progress is made when using .
- /// This will only be invoked for the initial download of the Realm and will not be invoked as futher download
- /// progress is made during the lifetime of the Realm. It is ignored when using
- /// .
- ///
- public Action OnProgress { get; set; }
-
- internal abstract ClientResyncMode ResyncMode { get; }
-
- ///
- /// Gets or sets a value indicating how detailed the sync client's logs will be.
- ///
- public static LogLevel LogLevel
- {
- get => SharedRealmHandleExtensions.GetLogLevel();
- set => SharedRealmHandleExtensions.SetLogLevel(value);
- }
-
- private static Action _customLogger;
-
- ///
- /// Gets or sets a custom log function that will be invoked by Sync instead of writing
- /// to the standard error. This must be set before using any of the sync API.
- ///
- ///
- /// This callback will not be invoked in a thread-safe manner, so it's up to the implementor to ensure
- /// that log messages arriving from multiple threads are processed without garbling the final output.
- ///
- /// The custom log function.
- public static Action CustomLogger
- {
- get => _customLogger;
- set
- {
- _customLogger = value;
- SharedRealmHandleExtensions.InstallLogCallback();
- }
- }
-
- private static string _userAgent;
-
- ///
- /// Gets or sets a string identifying this application which is included in the User-Agent
- /// header of sync connections.
- ///
- ///
- /// This property must be set prior to opening a synchronized Realm for the first
- /// time. Any modifications made after opening a Realm will be ignored.
- ///
- ///
- /// The custom user agent that will be appended to the one generated by the SDK.
- ///
- public static string UserAgent
- {
- get => _userAgent;
- set
- {
- Argument.NotNull(value, nameof(value));
- SharedRealmHandleExtensions.SetUserAgent(value);
- _userAgent = value;
- }
- }
-
- internal SyncConfigurationBase(Uri serverUri, User user = null, string optionalPath = null)
- {
- Argument.NotNull(serverUri, nameof(serverUri));
- Argument.Ensure(user != null || User.AllLoggedIn.Length == 1,
- "The user must be explicitly specified when the number of logged-in users is not 1.",
- nameof(user));
-
- User = user ?? User.Current;
- if (!serverUri.IsAbsoluteUri)
- {
- ServerUri = User.GetUriForRealm(serverUri);
- }
- else
- {
- Argument.Ensure(serverUri.Scheme.StartsWith("realm"), "Unexpected protocol for server url. Expected realm:// or realms://.", nameof(serverUri));
- ServerUri = serverUri;
- }
-
- DatabasePath = GetPathToRealm(optionalPath ?? SharedRealmHandleExtensions.GetRealmPath(User, ServerUri));
- }
-
- ///
- /// Configures various parameters of the sync system, such as the way users are persisted or the base
- /// path relative to which files will be saved.
- ///
- /// The user persistence mode.
- /// The key to encrypt the persistent user store with.
- /// If set to true reset the persistent user store on error.
- /// The base folder relative to which Realm files will be stored.
- ///
- /// Users are persisted in a realm file within the application's sandbox.
- ///
- /// By default objects are persisted and are additionally protected with an encryption key stored
- /// in the iOS Keychain when running on an iOS device (but not on a Simulator).
- /// On Android users are persisted in plaintext, because the AndroidKeyStore API is only supported on API level 18 and up.
- /// You might want to provide your own encryption key on Android or disable persistence for security reasons.
- ///
- ///
- public static void Initialize(UserPersistenceMode mode, byte[] encryptionKey = null, bool resetOnError = false, string basePath = null)
- {
- if (mode == UserPersistenceMode.Encrypted && encryptionKey != null && encryptionKey.Length != 64)
- {
- throw new ArgumentException("The encryption key must be 64 bytes long", nameof(encryptionKey));
- }
-
- SharedRealmHandleExtensions.Configure(mode, encryptionKey, resetOnError, basePath);
- }
-
- ///
- /// Enable multiplexing multiple sync sessions over a single connection.
- ///
- ///
- /// When having a lot of synchronized realms open, or when using
- /// the system might run out of file descriptors because of all the open sockets to the server.
- /// Session multiplexing is designed to alleviate that, but it might not work with a server configured with fail-over.
- /// Only use if you're seeing errors about reaching the file descriptor limit and you know you are using many sync sessions.
- ///
- /// Only call this method before opening any synchronized realms.
- ///
- ///
- public static void EnableSessionMultiplexing()
- {
- SharedRealmHandleExtensions.EnableSessionMultiplexing();
- }
-
- internal override Realm CreateRealm(RealmSchema schema)
- {
- var configuration = CreateConfiguration();
-
- 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);
- }
-
- [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The Realm instance will own its handle")]
- internal override async Task CreateRealmAsync(RealmSchema schema, CancellationToken cancellationToken)
- {
- var configuration = CreateConfiguration();
-
- var tcs = new TaskCompletionSource();
- var tcsHandle = GCHandle.Alloc(tcs);
- ProgressNotificationToken progressToken = null;
- try
- {
- using (var handle = SharedRealmHandleExtensions.OpenWithSyncAsync(configuration, ToNative(), schema, EncryptionKey, tcsHandle))
- {
- cancellationToken.Register(() =>
- {
- if (!handle.IsClosed)
- {
- handle.Cancel();
- tcs.TrySetCanceled();
- }
- });
-
- if (OnProgress != null)
- {
- progressToken = new ProgressNotificationToken(
- observer: (progress) =>
- {
- OnProgress(progress);
- },
- register: handle.RegisterProgressNotifier,
- unregister: (token) =>
- {
- if (!handle.IsClosed)
- {
- handle.UnregisterProgressNotifier(token);
- }
- });
- }
-
- using (var realmReference = await tcs.Task)
- {
- var realmPtr = SharedRealmHandle.ResolveFromReference(realmReference);
- var sharedRealmHandle = new SharedRealmHandle(realmPtr);
- if (IsDynamic && !schema.Any())
- {
- sharedRealmHandle.GetSchema(nativeSchema => schema = RealmSchema.CreateFromObjectStoreSchema(nativeSchema));
- }
-
- return new Realm(sharedRealmHandle, this, schema);
- }
- }
- }
- finally
- {
- tcsHandle.Free();
- progressToken?.Dispose();
- }
- }
-
- internal Native.SyncConfiguration ToNative()
- {
- if (!string.IsNullOrEmpty(TrustedCAPath) &&
- !File.Exists(TrustedCAPath))
- {
- throw new FileNotFoundException($"{nameof(TrustedCAPath)} has been specified, but the file was not found.", TrustedCAPath);
- }
-
- return new Native.SyncConfiguration
- {
- SyncUserHandle = User.Handle,
- Url = ServerUri.ToString(),
- client_validate_ssl = EnableSSLValidation,
- TrustedCAPath = TrustedCAPath,
- is_partial = !IsFullSync,
- PartialSyncIdentifier = null,
- client_resync_mode = ResyncMode,
- };
- }
-
- internal static string GetSDKUserAgent()
- {
- var version = typeof(SyncConfigurationBase).GetTypeInfo().Assembly.GetName().Version;
- return $"RealmDotNet/{version} ({RuntimeInformation.FrameworkDescription})";
- }
- }
-}
diff --git a/Realm/Realm/DataBinding/TypeInfoHelper.cs b/Realm/Realm/DataBinding/TypeInfoHelper.cs
index f492771a0d..ee20f52755 100644
--- a/Realm/Realm/DataBinding/TypeInfoHelper.cs
+++ b/Realm/Realm/DataBinding/TypeInfoHelper.cs
@@ -28,7 +28,7 @@ internal static class TypeInfoHelper
// Holds Type -> RealmObjectTypeInfo map to avoid creating a new TypeDelegator for each IReflectableType.GetTypeInfo invocation.
private static readonly ConcurrentDictionary TypeCache = new ConcurrentDictionary();
- public static TypeInfo GetInfo(RealmObject obj)
+ public static TypeInfo GetInfo(RealmObjectBase obj)
{
Argument.NotNull(obj, nameof(obj));
return TypeCache.GetOrAdd(obj.GetType(), t => new RealmObjectTypeDelegator(t));
diff --git a/Realm/Realm/DataBinding/WovenGetterMethodInfo.cs b/Realm/Realm/DataBinding/WovenGetterMethodInfo.cs
index 5e4e5085c6..f6bfa5d024 100644
--- a/Realm/Realm/DataBinding/WovenGetterMethodInfo.cs
+++ b/Realm/Realm/DataBinding/WovenGetterMethodInfo.cs
@@ -59,7 +59,7 @@ public WovenGetterMethodInfo(MethodInfo mi)
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
- var ro = obj as RealmObject;
+ var ro = obj as RealmObjectBase;
if (ro == null || ro.IsValid)
{
return _mi.Invoke(obj, invokeAttr, binder, parameters, culture);
diff --git a/Realm/Realm/DataBinding/WovenSetterMethodInfo.cs b/Realm/Realm/DataBinding/WovenSetterMethodInfo.cs
index dfab545fac..9e87490e74 100644
--- a/Realm/Realm/DataBinding/WovenSetterMethodInfo.cs
+++ b/Realm/Realm/DataBinding/WovenSetterMethodInfo.cs
@@ -59,7 +59,7 @@ public WovenSetterMethodInfo(MethodInfo mi)
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
- var managingRealm = (obj as RealmObject)?.Realm;
+ var managingRealm = (obj as RealmObjectBase)?.Realm;
Transaction writeTransaction = null;
if (managingRealm != null && !managingRealm.IsInTransaction)
{
diff --git a/Tests/Realm.Tests/Sync/Constants.cs b/Realm/Realm/Dynamic/DynamicEmbeddedObject.cs
similarity index 65%
rename from Tests/Realm.Tests/Sync/Constants.cs
rename to Realm/Realm/Dynamic/DynamicEmbeddedObject.cs
index b23712fe65..3b404b31a6 100644
--- a/Tests/Realm.Tests/Sync/Constants.cs
+++ b/Realm/Realm/Dynamic/DynamicEmbeddedObject.cs
@@ -16,15 +16,19 @@
//
////////////////////////////////////////////////////////////////////////////
-namespace Realms.Tests.Sync
+using System.ComponentModel;
+using System.Dynamic;
+using System.Linq.Expressions;
+
+namespace Realms.Dynamic
{
- public static class Constants
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Ignored]
+ public class DynamicEmbeddedObject : EmbeddedObject, IDynamicMetaObjectProvider
{
- public const string AdminUsername = "realm-admin";
- public const string AdminPassword = "";
-
- public static string RosUrl;
- public static string RosPort;
- public static string RosSecurePort;
+ public DynamicMetaObject GetMetaObject(Expression parameter)
+ {
+ return new MetaRealmObject(parameter, this);
+ }
}
}
\ No newline at end of file
diff --git a/Realm/Realm/Dynamic/DynamicRealmObjectHelper.cs b/Realm/Realm/Dynamic/DynamicRealmObjectHelper.cs
index 73385d40c2..c2b8a3c954 100644
--- a/Realm/Realm/Dynamic/DynamicRealmObjectHelper.cs
+++ b/Realm/Realm/Dynamic/DynamicRealmObjectHelper.cs
@@ -23,15 +23,30 @@ namespace Realms.Dynamic
{
internal class DynamicRealmObjectHelper : IRealmObjectHelper
{
- internal static readonly DynamicRealmObjectHelper Instance = new DynamicRealmObjectHelper();
+ private static readonly DynamicRealmObjectHelper _embeddedInstance = new DynamicRealmObjectHelper(embedded: true);
+ private static readonly DynamicRealmObjectHelper _objectInstance = new DynamicRealmObjectHelper(embedded: false);
- public void CopyToRealm(RealmObject instance, bool update, bool setPrimaryKey)
+ private readonly bool _embedded;
+
+ internal static DynamicRealmObjectHelper Instance(bool embedded) => embedded ? _embeddedInstance : _objectInstance;
+
+ private DynamicRealmObjectHelper(bool embedded)
+ {
+ _embedded = embedded;
+ }
+
+ public void CopyToRealm(RealmObjectBase instance, bool update, bool setPrimaryKey)
{
throw new NotSupportedException("DynamicRealmObjectHelper cannot exist in unmanaged state, so CopyToRealm should not be called ever.");
}
- public RealmObject CreateInstance()
+ public RealmObjectBase CreateInstance()
{
+ if (_embedded)
+ {
+ return new DynamicEmbeddedObject();
+ }
+
return new DynamicRealmObject();
}
diff --git a/Realm/Realm/Dynamic/MetaRealmList.cs b/Realm/Realm/Dynamic/MetaRealmList.cs
index c2778c09ad..d49fc2d86a 100644
--- a/Realm/Realm/Dynamic/MetaRealmList.cs
+++ b/Realm/Realm/Dynamic/MetaRealmList.cs
@@ -16,10 +16,10 @@
//
////////////////////////////////////////////////////////////////////////////
+using System;
using System.Dynamic;
using System.Linq;
using System.Linq.Expressions;
-using System.Reflection;
namespace Realms.Dynamic
{
@@ -46,5 +46,31 @@ public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMet
return new DynamicMetaObject(expression, BindingRestrictions.GetTypeRestriction(Expression, LimitType));
}
+
+ public override DynamicMetaObject BindSetIndex(SetIndexBinder binder, DynamicMetaObject[] indexes, DynamicMetaObject value)
+ {
+ if (Value is IRealmCollection)
+ {
+ throw new NotSupportedException("Can't set embedded objects directly. Instead use Realm.DynamicApi.SetEmbeddedObjectInList.");
+ }
+
+ return base.BindSetIndex(binder, indexes, value);
+ }
+
+ public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
+ {
+ if (Value is IRealmCollection)
+ {
+ switch (binder.Name)
+ {
+ case "Add":
+ throw new NotSupportedException("Can't add embedded objects directly. Instead use Realm.DynamicApi.AddEmbeddedObjectToList.");
+ case "Insert":
+ throw new NotSupportedException("Can't insert embedded objects directly. Instead use Realm.DynamicApi.InsertEmbeddedObjectInList.");
+ }
+ }
+
+ return base.BindInvokeMember(binder, args);
+ }
}
}
\ No newline at end of file
diff --git a/Realm/Realm/Dynamic/MetaRealmObject.cs b/Realm/Realm/Dynamic/MetaRealmObject.cs
index 96df08931f..beb7efb506 100644
--- a/Realm/Realm/Dynamic/MetaRealmObject.cs
+++ b/Realm/Realm/Dynamic/MetaRealmObject.cs
@@ -21,6 +21,8 @@
using System.Dynamic;
using System.Linq.Expressions;
using System.Reflection;
+using Realms.Exceptions;
+using Realms.Native;
using Realms.Schema;
namespace Realms.Dynamic
@@ -30,16 +32,23 @@ internal class MetaRealmObject : DynamicMetaObject
private const BindingFlags PrivateBindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
private readonly Realm _realm;
- private readonly RealmObject.Metadata _metadata;
+ private readonly RealmObjectBase.Metadata _metadata;
- private static readonly FieldInfo RealmObjectRealmField = typeof(RealmObject).GetField("_realm", PrivateBindingFlags);
- private static readonly FieldInfo RealmObjectObjectHandleField = typeof(RealmObject).GetField("_objectHandle", PrivateBindingFlags);
- private static readonly MethodInfo RealmObjectGetBacklinksForHandleMethod = typeof(RealmObject).GetMethod("GetBacklinksForHandle", PrivateBindingFlags)
- .MakeGenericMethod(typeof(DynamicRealmObject));
+ private static readonly FieldInfo RealmObjectRealmField = typeof(RealmObjectBase).GetField("_realm", PrivateBindingFlags);
+ private static readonly FieldInfo RealmObjectObjectHandleField = typeof(RealmObjectBase).GetField("_objectHandle", PrivateBindingFlags);
+
+ private static readonly MethodInfo RealmObjectGetBacklinksForHandle_RealmObject = typeof(DynamicRealmObject).GetMethod("GetBacklinksForHandle", PrivateBindingFlags)
+ .MakeGenericMethod(typeof(DynamicRealmObject));
+
+ private static readonly MethodInfo RealmObjectGetBacklinksForHandle_EmbeddedObject = typeof(DynamicRealmObject).GetMethod("GetBacklinksForHandle", PrivateBindingFlags)
+ .MakeGenericMethod(typeof(DynamicEmbeddedObject));
+
+ private static readonly MethodInfo PrimitiveValueGetMethod = typeof(PrimitiveValue).GetMethod(nameof(PrimitiveValue.Get), BindingFlags.Public | BindingFlags.Instance);
+ private static readonly MethodInfo CreatePrimitiveMethod = typeof(PrimitiveValue).GetMethod(nameof(PrimitiveValue.Create), BindingFlags.Public | BindingFlags.Static);
private static readonly ObjectHandle DummyHandle = new ObjectHandle(null, IntPtr.Zero);
- public MetaRealmObject(Expression expression, DynamicRealmObject value)
+ public MetaRealmObject(Expression expression, RealmObjectBase value)
: base(expression, BindingRestrictions.Empty, value)
{
_realm = value.Realm;
@@ -53,15 +62,17 @@ public override DynamicMetaObject BindGetMember(GetMemberBinder binder)
return base.BindGetMember(binder);
}
- var arguments = new List
- {
- Expression.Constant(_metadata.PropertyIndices[property.Name])
- };
-
+ var arguments = new List();
MethodInfo getter = null;
- if (property.Type.IsArray())
+ if (property.Type.UnderlyingType() == PropertyType.LinkingObjects)
+ {
+ arguments.Add(Expression.Constant(_metadata.PropertyIndices[property.Name]));
+ getter = GetGetMethod(DummyHandle.GetBacklinks);
+ }
+ else if (property.Type.IsArray())
{
- arguments.Insert(0, Expression.Field(GetLimitedSelf(), RealmObjectRealmField));
+ arguments.Add(Expression.Field(GetLimitedSelf(), RealmObjectRealmField));
+ arguments.Add(Expression.Constant(_metadata.PropertyIndices[property.Name]));
arguments.Add(Expression.Constant(property.ObjectType, typeof(string)));
switch (property.Type.UnderlyingType())
{
@@ -87,7 +98,7 @@ public override DynamicMetaObject BindGetMember(GetMemberBinder binder)
}
break;
- case Schema.PropertyType.Float:
+ case PropertyType.Float:
if (property.Type.IsNullable())
{
getter = GetGetMethod(DummyHandle.GetList);
@@ -127,85 +138,36 @@ public override DynamicMetaObject BindGetMember(GetMemberBinder binder)
break;
case PropertyType.Object:
- getter = GetGetMethod(DummyHandle.GetList);
- break;
- case PropertyType.LinkingObjects:
- // ObjectHandle.GetBacklinks has only one argument.
- arguments.Clear();
- arguments.Add(Expression.Constant(_metadata.PropertyIndices[property.Name]));
- getter = GetGetMethod(DummyHandle.GetBacklinks);
+ getter = IsTargetEmbedded(property) ? GetGetMethod(DummyHandle.GetList) : GetGetMethod(DummyHandle.GetList);
break;
}
}
else
{
+ arguments.Add(Expression.Constant(_metadata.PropertyIndices[property.Name]));
switch (property.Type.UnderlyingType())
{
case PropertyType.Int:
- if (property.Type.IsNullable())
- {
- getter = GetGetMethod(DummyHandle.GetNullableInt64);
- }
- else
- {
- getter = GetGetMethod(DummyHandle.GetInt64);
- }
-
- break;
case PropertyType.Bool:
- if (property.Type.IsNullable())
- {
- getter = GetGetMethod(DummyHandle.GetNullableBoolean);
- }
- else
- {
- getter = GetGetMethod(DummyHandle.GetBoolean);
- }
-
- break;
- case Schema.PropertyType.Float:
- if (property.Type.IsNullable())
- {
- getter = GetGetMethod(DummyHandle.GetNullableSingle);
- }
- else
- {
- getter = GetGetMethod(DummyHandle.GetSingle);
- }
-
- break;
+ case PropertyType.Float:
case PropertyType.Double:
- if (property.Type.IsNullable())
- {
- getter = GetGetMethod(DummyHandle.GetNullableDouble);
- }
- else
- {
- getter = GetGetMethod(DummyHandle.GetDouble);
- }
-
+ case PropertyType.Date:
+ case PropertyType.Decimal:
+ case PropertyType.ObjectId:
+ arguments.Add(Expression.Constant(property.Type));
+ getter = GetGetMethod(DummyHandle.GetPrimitive);
break;
case PropertyType.String:
getter = GetGetMethod(DummyHandle.GetString);
break;
case PropertyType.Data:
getter = GetGetMethod(DummyHandle.GetByteArray);
- break;
- case PropertyType.Date:
- if (property.Type.IsNullable())
- {
- getter = GetGetMethod(DummyHandle.GetNullableDateTimeOffset);
- }
- else
- {
- getter = GetGetMethod(DummyHandle.GetDateTimeOffset);
- }
-
break;
case PropertyType.Object:
arguments.Insert(0, Expression.Field(GetLimitedSelf(), RealmObjectRealmField));
arguments.Add(Expression.Constant(property.ObjectType));
- getter = GetGetMethod(DummyHandle.GetObject);
+
+ getter = IsTargetEmbedded(property) ? GetGetMethod(DummyHandle.GetObject) : GetGetMethod(DummyHandle.GetObject);
break;
}
}
@@ -216,7 +178,20 @@ public override DynamicMetaObject BindGetMember(GetMemberBinder binder)
if (property.Type.UnderlyingType() == PropertyType.LinkingObjects)
{
- expression = Expression.Call(self, RealmObjectGetBacklinksForHandleMethod, Expression.Constant(binder.Name), expression);
+ var relatedMeta = _realm.Metadata[property.ObjectType];
+ if (relatedMeta.Schema.IsEmbedded)
+ {
+ expression = Expression.Call(self, RealmObjectGetBacklinksForHandle_EmbeddedObject, Expression.Constant(binder.Name), expression);
+ }
+ else
+ {
+ expression = Expression.Call(self, RealmObjectGetBacklinksForHandle_RealmObject, Expression.Constant(binder.Name), expression);
+ }
+ }
+
+ if (expression.Type == typeof(PrimitiveValue))
+ {
+ expression = Expression.Call(expression, PrimitiveValueGetMethod.MakeGenericMethod(property.PropertyInfo.PropertyType));
}
if (binder.ReturnType != expression.Type)
@@ -224,7 +199,7 @@ public override DynamicMetaObject BindGetMember(GetMemberBinder binder)
expression = Expression.Convert(expression, binder.ReturnType);
}
- var argumentShouldBeDynamicRealmObject = BindingRestrictions.GetTypeRestriction(Expression, typeof(DynamicRealmObject));
+ var argumentShouldBeDynamicRealmObject = BindingRestrictions.GetTypeRestriction(Expression, _metadata.Schema.IsEmbedded ? typeof(DynamicEmbeddedObject) : typeof(DynamicRealmObject));
var argumentShouldBeInTheSameRealm = BindingRestrictions.GetInstanceRestriction(Expression.Field(self, RealmObjectRealmField), _realm);
return new DynamicMetaObject(expression, argumentShouldBeDynamicRealmObject.Merge(argumentShouldBeInTheSameRealm));
}
@@ -244,57 +219,26 @@ public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicM
MethodInfo setter = null;
Type argumentType = null;
+ var valueExpression = value.Expression;
switch (property.Type.UnderlyingType())
{
+ // TODO: split these into individual cases to avoid calling the generic method
case PropertyType.Int:
- argumentType = typeof(long);
- if (property.Type.IsNullable())
- {
- setter = GetSetMethod(DummyHandle.SetNullableInt64);
- }
- else if (property.IsPrimaryKey)
- {
- setter = GetSetMethod(DummyHandle.SetInt64Unique);
- }
- else
- {
- setter = GetSetMethod(DummyHandle.SetInt64);
- }
-
- break;
case PropertyType.Bool:
- argumentType = typeof(bool);
- if (property.Type.IsNullable())
- {
- setter = GetSetMethod(DummyHandle.SetNullableBoolean);
- }
- else
- {
- setter = GetSetMethod(DummyHandle.SetBoolean);
- }
-
- break;
case PropertyType.Float:
- argumentType = typeof(float);
- if (property.Type.IsNullable())
- {
- setter = GetSetMethod(DummyHandle.SetNullableSingle);
- }
- else
- {
- setter = GetSetMethod(DummyHandle.SetSingle);
- }
-
- break;
case PropertyType.Double:
- argumentType = typeof(double);
- if (property.Type.IsNullable())
+ case PropertyType.Date:
+ case PropertyType.Decimal:
+ case PropertyType.ObjectId:
+ argumentType = typeof(PrimitiveValue);
+ valueExpression = Expression.Call(CreatePrimitiveMethod.MakeGenericMethod(valueExpression.Type), new[] { valueExpression, Expression.Constant(property.Type) });
+ if (property.IsPrimaryKey)
{
- setter = GetSetMethod(DummyHandle.SetNullableDouble);
+ setter = GetSetMethod(DummyHandle.SetPrimitiveUnique);
}
else
{
- setter = GetSetMethod(DummyHandle.SetDouble);
+ setter = GetSetMethod(DummyHandle.SetPrimitive);
}
break;
@@ -313,32 +257,14 @@ public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicM
case PropertyType.Data:
argumentType = typeof(byte[]);
setter = GetSetMethod(DummyHandle.SetByteArray);
- break;
- case PropertyType.Date:
- argumentType = typeof(DateTimeOffset);
- if (property.Type.IsNullable())
- {
- setter = GetSetMethod(DummyHandle.SetNullableDateTimeOffset);
- }
- else
- {
- setter = GetSetMethod(DummyHandle.SetDateTimeOffset);
- }
-
break;
case PropertyType.Object:
- argumentType = typeof(RealmObject);
+ argumentType = typeof(RealmObjectBase);
arguments.Insert(0, Expression.Field(GetLimitedSelf(), RealmObjectRealmField));
- setter = GetSetMethod(DummyHandle.SetObject);
+ setter = GetSetMethod(DummyHandle.SetObject);
break;
}
- if (property.Type.IsNullable() && argumentType.GetTypeInfo().IsValueType)
- {
- argumentType = typeof(Nullable<>).MakeGenericType(argumentType);
- }
-
- var valueExpression = value.Expression;
if (valueExpression.Type != argumentType)
{
valueExpression = Expression.Convert(valueExpression, argumentType);
@@ -348,7 +274,7 @@ public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicM
var expression = Expression.Block(Expression.Call(Expression.Field(GetLimitedSelf(), RealmObjectObjectHandleField), setter, arguments), Expression.Default(binder.ReturnType));
- var argumentShouldBeDynamicRealmObject = BindingRestrictions.GetTypeRestriction(Expression, typeof(DynamicRealmObject));
+ var argumentShouldBeDynamicRealmObject = BindingRestrictions.GetTypeRestriction(Expression, _metadata.Schema.IsEmbedded ? typeof(DynamicEmbeddedObject) : typeof(DynamicRealmObject));
var argumentShouldBeInTheSameRealm = BindingRestrictions.GetInstanceRestriction(Expression.Field(GetLimitedSelf(), RealmObjectRealmField), _realm);
return new DynamicMetaObject(expression, argumentShouldBeDynamicRealmObject.Merge(argumentShouldBeInTheSameRealm));
}
@@ -369,12 +295,32 @@ private Expression GetLimitedSelf()
return convertedExpression;
}
+ private bool IsTargetEmbedded(Property property)
+ {
+ if (!_realm.Metadata.TryGetValue(property.ObjectType, out var metadata))
+ {
+ throw new RealmException($"Couldn't find metadata for type {property.ObjectType}.");
+ }
+
+ return metadata.Schema.IsEmbedded;
+ }
+
+ // GetString(propertyIndex)
+ // GetByteArray(propertyIndex)
+ // GetBacklinks(propertyIndex)
private static MethodInfo GetGetMethod(Func @delegate) => @delegate.GetMethodInfo();
- private static MethodInfo GetSetMethod(Action @delegate) => @delegate.GetMethodInfo();
+ // GetPrimitive(propertyIndex, propertyType)
+ private static MethodInfo GetGetMethod(Func @delegate) => @delegate.GetMethodInfo();
+ // GetList(realm, propertyIndex, objectType)
+ // GetObject(realm, propertyIndex, objectType)
private static MethodInfo GetGetMethod(Func @delegate) => @delegate.GetMethodInfo();
+ // SetXXX(propertyIndex)
+ private static MethodInfo GetSetMethod(Action @delegate) => @delegate.GetMethodInfo();
+
+ // SetObject(this, propertyIndex)
private static MethodInfo GetSetMethod(Action @delegate) => @delegate.GetMethodInfo();
}
}
\ No newline at end of file
diff --git a/Realm/Realm/Sync/Permissions/Recipient.cs b/Realm/Realm/EmbeddedObject.cs
similarity index 65%
rename from Realm/Realm/Sync/Permissions/Recipient.cs
rename to Realm/Realm/EmbeddedObject.cs
index e6d4df5171..cf08bf8f3f 100644
--- a/Realm/Realm/Sync/Permissions/Recipient.cs
+++ b/Realm/Realm/EmbeddedObject.cs
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
-// Copyright 2017 Realm Inc.
+// Copyright 2020 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,26 +16,20 @@
//
////////////////////////////////////////////////////////////////////////////
-namespace Realms.Sync
+using System;
+
+namespace Realms
{
///
- /// The user affected by the permission change.
+ /// Base for any embedded object that can be persisted in a .
///
- public enum Recipient
+ [Serializable]
+ public class EmbeddedObject : RealmObjectBase
{
///
- /// Any user - either current or someone else.
- ///
- Any,
-
- ///
- /// The current user.
- ///
- CurrentUser,
-
- ///
- /// User other than the current one.
+ /// Gets the parent of this . It can be either another
+ /// or a standalone .
///
- OtherUser,
+ public RealmObjectBase Parent { get; }
}
}
diff --git a/Realm/Realm/Exceptions/AppException.cs b/Realm/Realm/Exceptions/AppException.cs
new file mode 100644
index 0000000000..0e4e0410e8
--- /dev/null
+++ b/Realm/Realm/Exceptions/AppException.cs
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Net;
+using Realms.Sync.Native;
+
+namespace Realms.Sync.Exceptions
+{
+ ///
+ /// An exception thrown from operations interacting with a MongoDB Realm app.
+ ///
+ public class AppException : Exception
+ {
+ ///
+ /// Gets the HTTP status code returned by the remote operation.
+ ///
+ /// The HTTP status code of the operation that failed or null if the error was not an http one.
+ public HttpStatusCode? StatusCode { get; }
+
+ internal AppException(AppError appError)
+ : this($"{appError.ErrorCategory}: {appError.Message}", appError.LogsLink, appError.http_status_code)
+ {
+ }
+
+ internal AppException(string message, string helpLink, int httpStatusCode)
+ : base(message)
+ {
+ HelpLink = helpLink;
+ if (httpStatusCode != 0)
+ {
+ StatusCode = (HttpStatusCode)httpStatusCode;
+ }
+ }
+ }
+}
diff --git a/Realm/Realm/Exceptions/ClientResetException.cs b/Realm/Realm/Exceptions/ClientResetException.cs
index 51987ebbca..b8e1539e71 100644
--- a/Realm/Realm/Exceptions/ClientResetException.cs
+++ b/Realm/Realm/Exceptions/ClientResetException.cs
@@ -27,6 +27,7 @@ namespace Realms.Sync.Exceptions
public class ClientResetException : SessionException
{
private readonly string _originalFilePath;
+ private readonly App _app;
///
/// Gets the path where the backup copy of the realm will be placed once the client reset process is complete.
@@ -34,11 +35,12 @@ public class ClientResetException : SessionException
/// The path to the backup realm.
public string BackupFilePath { get; }
- internal ClientResetException(string message, IDictionary userInfo)
+ internal ClientResetException(App app, string message, IDictionary userInfo)
: base(message, ErrorCode.DivergingHistories)
{
// Using Path.GetFullPath to normalize path separators on Windows
_originalFilePath = Path.GetFullPath(userInfo[OriginalFilePathKey]);
+ _app = app;
BackupFilePath = Path.GetFullPath(userInfo[BackupFilePathKey]);
HelpLink = "https://realm.io/docs/xamarin/latest/#client-reset";
}
@@ -53,7 +55,7 @@ internal ClientResetException(string message, IDictionary userIn
///
public bool InitiateClientReset()
{
- return SharedRealmHandleExtensions.ImmediatelyRunFileActions(_originalFilePath);
+ return _app.Handle.ImmediatelyRunFileActions(_originalFilePath);
}
}
}
diff --git a/Realm/Realm/Exceptions/ErrorCode.cs b/Realm/Realm/Exceptions/ErrorCode.cs
index 52663453e3..a7938bb946 100644
--- a/Realm/Realm/Exceptions/ErrorCode.cs
+++ b/Realm/Realm/Exceptions/ErrorCode.cs
@@ -98,6 +98,30 @@ public enum ErrorCode
///
DisabledSession = 213,
+ ///
+ /// The client file is invalid.
+ ///
+ BadClientFile = 217,
+
+ ///
+ /// The user for this session doesn't match the user who originally created the file. This can happen
+ /// if you explicitly specify the Realm file path in the configuration and you open the Realm first with
+ /// user A, then with user B without changing the on-disk path.
+ ///
+ UserMismatch = 223,
+
+ ///
+ /// The server has received too many sessions from this client. This is typically a transient error
+ /// but can also indicate that the client has too many Realms open at the same time.
+ ///
+ TooManySessions = 224,
+
+ ///
+ /// The client attempted to upload an invalid schema change - either an additive schema change
+ /// when developer mode is off or a destructive schema change.
+ ///
+ InvalidSchemaChange = 225,
+
///
/// Your request parameters did not validate.
///
diff --git a/Realm/Realm/Exceptions/HttpException.cs b/Realm/Realm/Exceptions/HttpException.cs
deleted file mode 100644
index 6d4d8f154d..0000000000
--- a/Realm/Realm/Exceptions/HttpException.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Net;
-
-using ErrorCodeEnum = Realms.Sync.Exceptions.ErrorCode;
-
-namespace Realms.Sync.Exceptions
-{
- ///
- /// An exception thrown when a transport error occurs during authentication.
- ///
- public class HttpException : Exception
- {
- ///
- /// Gets the of the error.
- ///
- /// An enum value indicating the error code.
- public ErrorCodeEnum? ErrorCode { get; }
-
- ///
- /// Gets the of the response.
- ///
- /// A well known .
- public HttpStatusCode StatusCode { get; }
-
- ///
- /// Gets the Reason-Phrase of the HTTP response.
- ///
- /// The Reason-Phrase of the HTTP response.
- public string ReasonPhrase { get; }
-
- ///
- /// Gets the body of the HTTP response.
- ///
- /// The body of the HTTP response.
- public string Payload { get; }
-
- internal HttpException(HttpStatusCode statusCode, string reasonPhrase, string payload, string message, ErrorCodeEnum errorCode = ErrorCodeEnum.Unknown) : base(message)
- {
- StatusCode = statusCode;
- ReasonPhrase = reasonPhrase;
- Payload = payload;
- ErrorCode = errorCode;
- }
- }
-}
diff --git a/Realm/Realm/Exceptions/NotifierStartException.cs b/Realm/Realm/Exceptions/NotifierStartException.cs
deleted file mode 100644
index c1e1fd8758..0000000000
--- a/Realm/Realm/Exceptions/NotifierStartException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2019 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using Realms.Exceptions;
-
-namespace Realms.Server.Exceptions
-{
- ///
- /// An exception thrown while attempting to start the Notifier.
- ///
- public class NotifierStartException : RealmException
- {
- ///
- /// Gets an integer value representing the code of the error.
- ///
- /// An integer error code.
- public int ErrorCode { get; }
-
- internal NotifierStartException(int errorCode, string detailMessage) : base(detailMessage)
- {
- ErrorCode = errorCode;
- }
- }
-}
diff --git a/Realm/Realm/Exceptions/PermissionDeniedException.cs b/Realm/Realm/Exceptions/PermissionDeniedException.cs
index 41e012593e..ad3aab4a11 100644
--- a/Realm/Realm/Exceptions/PermissionDeniedException.cs
+++ b/Realm/Realm/Exceptions/PermissionDeniedException.cs
@@ -42,13 +42,15 @@ namespace Realms.Sync.Exceptions
public class PermissionDeniedException : SessionException
{
private readonly string _originalFilePath;
+ private readonly App _app;
private bool _actionInvoked;
- internal PermissionDeniedException(string message, IDictionary userInfo)
+ internal PermissionDeniedException(App app, string message, IDictionary userInfo)
: base(message, ErrorCode.PermissionDenied)
{
_originalFilePath = userInfo[OriginalFilePathKey];
+ _app = app;
HelpLink = "https://realm.io/docs/xamarin/latest/#access-control";
}
@@ -63,7 +65,7 @@ public bool DeleteRealmUserInfo()
Argument.Ensure(!_actionInvoked, $"{nameof(DeleteRealmUserInfo)} can only be called once.");
_actionInvoked = true;
- return SharedRealmHandleExtensions.ImmediatelyRunFileActions(_originalFilePath);
+ return _app.Handle.ImmediatelyRunFileActions(_originalFilePath);
}
}
}
diff --git a/Realm/Realm/Exceptions/RealmAppException.cs b/Realm/Realm/Exceptions/RealmAppException.cs
new file mode 100644
index 0000000000..6d81e765f8
--- /dev/null
+++ b/Realm/Realm/Exceptions/RealmAppException.cs
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using Realms.Exceptions;
+
+namespace Realms.Sync.Exceptions
+{
+ ///
+ /// An exception being thrown when performing app-related operations.
+ ///
+ public class RealmAppException : RealmException
+ {
+ ///
+ /// Gets the category (type) of this exception.
+ ///
+ /// The exception category - for example Client Error, Http Error, etc.
+ public string Category { get; }
+
+ internal RealmAppException(RealmExceptionCodes code, string detailMessage) : base(detailMessage)
+ {
+ Category = GetCategory(code);
+ }
+
+ private static string GetCategory(RealmExceptionCodes code)
+ {
+ return code switch
+ {
+ RealmExceptionCodes.AppClientError => "Client Error",
+ RealmExceptionCodes.AppCustomError => "Custom Error",
+ RealmExceptionCodes.AppHttpError => "Http Error",
+ RealmExceptionCodes.AppJsonError => "Json Error",
+ RealmExceptionCodes.AppServiceError => "Service Error",
+ _ => "Unknown"
+ };
+ }
+ }
+}
diff --git a/Realm/Realm/Exceptions/RealmException.cs b/Realm/Realm/Exceptions/RealmException.cs
index 577308d5e0..be7fbe78c5 100644
--- a/Realm/Realm/Exceptions/RealmException.cs
+++ b/Realm/Realm/Exceptions/RealmException.cs
@@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
+using Realms.Sync.Exceptions;
namespace Realms.Exceptions
{
@@ -105,6 +106,14 @@ internal static Exception Create(RealmExceptionCodes exceptionCode, string messa
case RealmExceptionCodes.RealmClosed:
return new RealmClosedException(message);
+ case RealmExceptionCodes.AppClientError:
+ case RealmExceptionCodes.AppCustomError:
+ case RealmExceptionCodes.AppHttpError:
+ case RealmExceptionCodes.AppJsonError:
+ case RealmExceptionCodes.AppServiceError:
+ case RealmExceptionCodes.AppUnknownError:
+ return new RealmAppException(exceptionCode, message);
+
case RealmExceptionCodes.StdArgumentOutOfRange:
case RealmExceptionCodes.StdIndexOutOfRange:
return new ArgumentOutOfRangeException(message);
@@ -115,9 +124,6 @@ internal static Exception Create(RealmExceptionCodes exceptionCode, string messa
case RealmExceptionCodes.ObjectManagedByAnotherRealm:
return new RealmObjectManagedByAnotherRealmException(message);
- case RealmExceptionCodes.RealmFeatureUnavailable:
- return new RealmFeatureUnavailableException(message);
-
default:
return new Exception(message);
}
diff --git a/Realm/Realm/Exceptions/RealmExceptionCodes.cs b/Realm/Realm/Exceptions/RealmExceptionCodes.cs
index efd676aee5..6175983219 100644
--- a/Realm/Realm/Exceptions/RealmExceptionCodes.cs
+++ b/Realm/Realm/Exceptions/RealmExceptionCodes.cs
@@ -41,11 +41,16 @@ internal enum RealmExceptionCodes : sbyte
RealmDuplicatePrimaryKeyValue = 23,
RealmClosed = 24,
ObjectManagedByAnotherRealm = 25,
- RealmFeatureUnavailable = 26,
- RealmIncompatibleSyncedFile = 27,
RealmDotNetExceptionDuringMigration = 30,
+ AppClientError = 50,
+ AppCustomError = 51,
+ AppHttpError = 52,
+ AppJsonError = 53,
+ AppServiceError = 54,
+ AppUnknownError = 59,
+
StdArgumentOutOfRange = 100,
StdIndexOutOfRange = 101,
StdInvalidOperation = 102
diff --git a/Realm/Realm/Exceptions/RealmFeatureUnavailableException.cs b/Realm/Realm/Exceptions/RealmFeatureUnavailableException.cs
deleted file mode 100644
index 1f8571c54b..0000000000
--- a/Realm/Realm/Exceptions/RealmFeatureUnavailableException.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2017 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-namespace Realms.Exceptions
-{
- ///
- /// An exception thrown when attempting to use a feature that is not available at your edition level.
- /// If you're using a paid edition of the Realm Platform, make sure you call
- /// SyncConfiguration.SetFeatureToken before any calls to .
- ///
- ///
- /// See more details on Enabling Professional and Enterprise APIs in the documentation.
- ///
- public class RealmFeatureUnavailableException : RealmException
- {
- internal RealmFeatureUnavailableException(string message) : base(message)
- {
- HelpLink = "https://realm.io/docs/realm-object-server/pe-ee/#enabling-professional-and-enterprise-apis";
- }
- }
-}
\ No newline at end of file
diff --git a/Realm/Realm/Exceptions/RealmFrozenException.cs b/Realm/Realm/Exceptions/RealmFrozenException.cs
index 06222690c4..9fcb7d7a1e 100644
--- a/Realm/Realm/Exceptions/RealmFrozenException.cs
+++ b/Realm/Realm/Exceptions/RealmFrozenException.cs
@@ -19,8 +19,8 @@
namespace Realms.Exceptions
{
///
- /// Exception thrown when trying to subscribe to changes or modify a frozen , , or
- /// .
+ /// Exception thrown when trying to subscribe to changes or modify a frozen , ,
+ /// , or .
///
public class RealmFrozenException : RealmException
{
diff --git a/Realm/Realm/Exceptions/RealmObjectManagedByAnotherRealmException.cs b/Realm/Realm/Exceptions/RealmObjectManagedByAnotherRealmException.cs
index c71203a7f3..ecda663bcc 100644
--- a/Realm/Realm/Exceptions/RealmObjectManagedByAnotherRealmException.cs
+++ b/Realm/Realm/Exceptions/RealmObjectManagedByAnotherRealmException.cs
@@ -19,7 +19,7 @@
namespace Realms.Exceptions
{
///
- /// Exception thrown when you're trying to use but the object is already managed by a
+ /// Exception thrown when you're trying to use but the object is already managed by a
/// different .
///
public class RealmObjectManagedByAnotherRealmException : RealmException
diff --git a/Realm/Realm/Exceptions/SessionException.cs b/Realm/Realm/Exceptions/SessionException.cs
index a1a61332d3..b4235c148d 100644
--- a/Realm/Realm/Exceptions/SessionException.cs
+++ b/Realm/Realm/Exceptions/SessionException.cs
@@ -37,7 +37,6 @@ public class SessionException : Exception
internal SessionException(string message, ErrorCode errorCode, Exception innerException = null) : base(message, innerException)
{
ErrorCode = errorCode;
- HelpLink = "https://realm.io/docs/realm-object-server/#session-specific-errors";
}
}
}
diff --git a/Realm/Realm/Extensions/CollectionNotificationsExtensions.cs b/Realm/Realm/Extensions/CollectionNotificationsExtensions.cs
index 46efb67ee1..fa31b2d7cc 100644
--- a/Realm/Realm/Extensions/CollectionNotificationsExtensions.cs
+++ b/Realm/Realm/Extensions/CollectionNotificationsExtensions.cs
@@ -36,11 +36,11 @@ public static class CollectionNotificationsExtensions
/// implements .
///
/// The to observe for changes.
- /// Type of the in the results.
+ /// Type of the or in the results.
///
/// The collection, implementing .
public static IRealmCollection AsRealmCollection(this IQueryable query)
- where T : RealmObject
+ where T : RealmObjectBase
{
Argument.NotNull(query, nameof(query));
@@ -56,7 +56,7 @@ public static IRealmCollection AsRealmCollection(this IQueryable query)
/// A convenience method that casts to and subscribes for change notifications.
///
/// The to observe for changes.
- /// Type of the in the results.
+ /// Type of the or in the results.
///
/// The callback to be invoked with the updated .
///
@@ -64,7 +64,7 @@ public static IRealmCollection AsRealmCollection(this IQueryable query)
/// To stop receiving notifications, call .
///
public static IDisposable SubscribeForNotifications(this IQueryable results, NotificationCallbackDelegate callback)
- where T : RealmObject
+ where T : RealmObjectBase
{
return results.AsRealmCollection().SubscribeForNotifications(callback);
}
diff --git a/Realm/Realm/Extensions/ErrorCodeExtensions.cs b/Realm/Realm/Extensions/ErrorCodeExtensions.cs
deleted file mode 100644
index 6d87365b6d..0000000000
--- a/Realm/Realm/Extensions/ErrorCodeExtensions.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2020 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-
-namespace Realms.Sync.Exceptions
-{
- ///
- /// A set of extensions that simplify checking for common error scenarios.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static class ErrorCodeExtensions
- {
- private static readonly IEnumerable ClientResetCodes = new[]
- {
- ErrorCode.BadServerFileIdentifier,
- ErrorCode.BadClientFileIdentifier,
- ErrorCode.BadServerVersion,
- ErrorCode.DivergingHistories,
- };
-
- ///
- /// Checks if an error code indicates that a client reset is needed.
- ///
- /// true , if the code indicates a client reset error, false otherwise.
- /// The error code.
- public static bool IsClientResetError(this ErrorCode code)
- {
- return ClientResetCodes.Contains(code);
- }
- }
-}
diff --git a/Realm/Realm/Extensions/FrozenObjectsExtensions.cs b/Realm/Realm/Extensions/FrozenObjectsExtensions.cs
index ec6af2e716..a805f5cdd1 100644
--- a/Realm/Realm/Extensions/FrozenObjectsExtensions.cs
+++ b/Realm/Realm/Extensions/FrozenObjectsExtensions.cs
@@ -25,7 +25,7 @@
namespace Realms
{
///
- /// A set of extension methods on top of RealmObject.
+ /// A set of extension methods on top of RealmObjectBase.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public static class FrozenObjectsExtensions
@@ -33,7 +33,7 @@ public static class FrozenObjectsExtensions
///
/// Returns a frozen snapshot of this object. The frozen copy can be read and queried from any thread without throwing an exception.
///
- /// Freezing a RealmObject also creates a frozen Realm which has its own lifecycle, but if the live Realm that spawned the
+ /// Freezing a RealmObjectBase also creates a frozen Realm which has its own lifecycle, but if the live Realm that spawned the
/// original object is fully closed (i.e. all instances across all threads are closed), the frozen Realm and
/// object will be closed as well.
///
@@ -43,12 +43,12 @@ public static class FrozenObjectsExtensions
/// Note: Keeping a large number of frozen objects with different versions alive can have a negative impact on the filesize
/// of the Realm. In order to avoid such a situation it is possible to set .
///
- /// The instance that you want to create a frozen version of.
- /// The type of the .
+ /// The or instance that you want to create a frozen version of.
+ /// The type of the / .
/// A new frozen instance of the passed in object or the object itself if it was already frozen.
- ///
+ ///
public static T Freeze(this T realmObj)
- where T : RealmObject
+ where T : RealmObjectBase
{
Argument.NotNull(realmObj, nameof(realmObj));
@@ -105,10 +105,10 @@ public static IList Freeze(this IList list)
/// of the Realm. In order to avoid such a situation it is possible to set .
///
/// The query you want to create a frozen copy of.
- /// The type of the in the query.
+ /// The type of the / in the query.
/// A frozen copy of this query.
public static IQueryable Freeze(this IQueryable query)
- where T : RealmObject
+ where T : RealmObjectBase
{
Argument.NotNull(query, nameof(query));
diff --git a/Realm/Realm/Extensions/RealmSyncExtensions.cs b/Realm/Realm/Extensions/RealmSyncExtensions.cs
index c13e21a7aa..332dfad44b 100644
--- a/Realm/Realm/Extensions/RealmSyncExtensions.cs
+++ b/Realm/Realm/Extensions/RealmSyncExtensions.cs
@@ -31,16 +31,17 @@ public static class RealmSyncExtensions
///
/// Gets the for the realm file behind this .
///
- /// The that is responsible for synchronizing with a Realm Object Server instance.
- /// An instance of the class created with a object.
- /// Thrown if realm is null .
- /// Thrown if the realm was not created with a object.
+ /// The that is responsible for synchronizing with the MongoDB Realm server.
+ /// An instance of the class created with a object.
+ /// Thrown if is null .
+ /// Thrown if the was not created with a object.
public static Session GetSession(this Realm realm)
{
Argument.NotNull(realm, nameof(realm));
- Argument.Ensure(realm.Config is SyncConfigurationBase, "Cannot get a Session for a Realm without a SyncConfiguration", nameof(realm));
+ var syncConfig = Argument.EnsureType(realm.Config, "Cannot get a Session for a Realm without a SyncConfiguration", nameof(realm));
- return new Session(realm.Config.DatabasePath);
+ var session = syncConfig.User.App.Handle.GetSessionForPath(realm.SharedRealmHandle);
+ return new Session(session);
}
}
}
diff --git a/Realm/Realm/Extensions/ReflectionExtensions.cs b/Realm/Realm/Extensions/ReflectionExtensions.cs
index da18279298..ffd30f3ab9 100644
--- a/Realm/Realm/Extensions/ReflectionExtensions.cs
+++ b/Realm/Realm/Extensions/ReflectionExtensions.cs
@@ -44,5 +44,9 @@ public static bool HasCustomAttribute(this MemberInfo member)
=> member.CustomAttributes.Any(a => a.AttributeType == typeof(T));
public static string GetMappedOrOriginalName(this MemberInfo member) => member?.GetCustomAttribute()?.Mapping ?? member?.Name;
+
+ public static bool IsEmbeddedObject(this Type type) => type == typeof(EmbeddedObject) || type.BaseType == typeof(EmbeddedObject);
+
+ public static bool IsRealmObject(this Type type) => type == typeof(RealmObject) || type.BaseType == typeof(RealmObject);
}
}
diff --git a/Realm/Realm/Extensions/StringExtensions.cs b/Realm/Realm/Extensions/StringExtensions.cs
index a1ea646681..27a5661d53 100644
--- a/Realm/Realm/Extensions/StringExtensions.cs
+++ b/Realm/Realm/Extensions/StringExtensions.cs
@@ -77,5 +77,7 @@ public static bool Like(this string str, string pattern, bool caseSensitive = tr
var options = caseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase;
return Regex.Match(str, $"^{pattern}$", options).Success;
}
+
+ internal static IntPtr IntPtrLength(this string str) => (IntPtr)(str?.Length ?? 0);
}
}
diff --git a/Realm/Realm/Extensions/TestingExtensions.cs b/Realm/Realm/Extensions/TestingExtensions.cs
index c98eea6aad..fb5db5517a 100644
--- a/Realm/Realm/Extensions/TestingExtensions.cs
+++ b/Realm/Realm/Extensions/TestingExtensions.cs
@@ -34,7 +34,7 @@ public static class TestingExtensions
/// Error message.
/// If set to true the error will be marked as fatal.
///
- /// Use this method to test your error handling code without connecting to a Realm Object Server.
+ /// Use this method to test your error handling code without connecting to a MongoDB Realm Server.
/// Some error codes, such as will be ignored and will not be reported
/// to subscribers.
///
diff --git a/Realm/Realm/GlobalSuppressions.cs b/Realm/Realm/GlobalSuppressions.cs
index 2353b4b289..123f85b1f2 100644
--- a/Realm/Realm/GlobalSuppressions.cs
+++ b/Realm/Realm/GlobalSuppressions.cs
@@ -2,14 +2,12 @@
[assembly: SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "Copied from Xamarin's implementation", Scope = "type", Target = "~T:Realms.PreserveAttribute")]
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:Fields should be private", Justification = "Copied from Xamarin's implementation", Scope = "type", Target = "~T:Realms.PreserveAttribute")]
-[assembly: SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "This is checked in the base class.", Scope = "member", Target = "~M:Realms.Sync.FullSyncConfiguration.#ctor(System.Uri,Realms.Sync.User,System.String)")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "Shouldn't be used directly.", Scope = "type", Target = "~T:Realms.Dynamic.DynamicRealmObject")]
+[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "Shouldn't be used directly.", Scope = "type", Target = "~T:Realms.Dynamic.DynamicEmbeddedObject")]
[assembly: SuppressMessage("Performance", "CA1820:Test for empty strings using string length", Justification = "We're only capturing the method group.", Scope = "type", Target = "~T:Realms.RealmResultsVisitor.Methods.String")]
[assembly: SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly", Justification = "index is the argument name for ElementAt.", Scope = "member", Target = "~M:Realms.RealmResultsVisitor.VisitMethodCall(System.Linq.Expressions.MethodCallExpression)~System.Linq.Expressions.Expression")]
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1121:Use built-in type alias", Justification = "Native structs use verbose names.", Scope = "namespaceanddescendants", Target = "Realms.Native")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Native structs use snake_case fields.", Scope = "namespaceanddescendants", Target = "Realms.Native")]
-[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1121:Use built-in type alias", Justification = "Native structs use verbose names.", Scope = "namespaceanddescendants", Target = "Realms.Server.Native")]
-[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Native structs use snake_case fields.", Scope = "namespaceanddescendants", Target = "Realms.Server.Native")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "Native methods are snake_case.", Scope = "type", Target = "~T:Realms.NativeCommon")]
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Native methods are snake_case.", Scope = "type", Target = "~T:Realms.NativeCommon")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Native structs use snake_case fields.", Scope = "type", Target = "~T:Realms.NativeException")]
@@ -20,5 +18,5 @@
[assembly: SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "Will be a breaking change to rename.", Scope = "type", Target = "~T:Realms.Schema.Property")]
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "This is the private event", Scope = "member", Target = "~E:Realms.RealmCollectionBase`1._collectionChanged")]
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "This is the private event", Scope = "member", Target = "~E:Realms.RealmCollectionBase`1._propertyChanged")]
-[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "This is the private event", Scope = "member", Target = "~E:Realms.RealmObject._propertyChanged")]
+[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "This is the private event", Scope = "member", Target = "~E:Realms.RealmObjectBase._propertyChanged")]
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "This is the private event", Scope = "member", Target = "~E:Realms.Realm._realmChanged")]
diff --git a/Realm/Realm/Handles/AppHandle.EmailPassword.cs b/Realm/Realm/Handles/AppHandle.EmailPassword.cs
new file mode 100644
index 0000000000..3b49a72a95
--- /dev/null
+++ b/Realm/Realm/Handles/AppHandle.EmailPassword.cs
@@ -0,0 +1,135 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+
+namespace Realms.Sync
+{
+ internal partial class AppHandle : RealmHandle
+ {
+ private static class EmailNativeMethods
+ {
+#pragma warning disable IDE1006 // Naming Styles
+#pragma warning disable SA1121 // Use built-in type alias
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_register_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void register_user(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string username, IntPtr username_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string password, IntPtr password_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_confirm_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void confirm_user(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string token, IntPtr token_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string token_id, IntPtr token_id_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_resend_confirmation_email", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void resend_confirmation_email(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string email, IntPtr email_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_send_reset_password_email", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void send_reset_password_email(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string email, IntPtr email_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_reset_password", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void reset_password(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string password, IntPtr password_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string token, IntPtr token_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string token_id, IntPtr token_id_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_call_reset_password_function", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void call_reset_password_function(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string username, IntPtr username_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string password, IntPtr password_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string function_args, IntPtr function_args_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+#pragma warning restore IDE1006 // Naming Styles
+#pragma warning restore SA1121 // Use built-in type alias
+ }
+
+ public readonly EmailPasswordApi EmailPassword;
+
+ public class EmailPasswordApi
+ {
+ private readonly AppHandle _appHandle;
+
+ public EmailPasswordApi(AppHandle handle)
+ {
+ _appHandle = handle;
+ }
+
+ public void RegisterUser(string username, string password, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ EmailNativeMethods.register_user(_appHandle, username, (IntPtr)username.Length, password, (IntPtr)password.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
+ }
+
+ public void ConfirmUser(string token, string tokenId, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ EmailNativeMethods.confirm_user(_appHandle, token, (IntPtr)token.Length, tokenId, (IntPtr)tokenId.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
+ }
+
+ public void ResendConfirmationEmail(string email, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ EmailNativeMethods.resend_confirmation_email(_appHandle, email, (IntPtr)email.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
+ }
+
+ public void SendResetPasswordEmail(string username, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ EmailNativeMethods.send_reset_password_email(_appHandle, username, (IntPtr)username.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
+ }
+
+ public void ResetPassword(string password, string token, string tokenId, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ EmailNativeMethods.reset_password(
+ _appHandle,
+ password, (IntPtr)password.Length,
+ token, (IntPtr)token.Length,
+ tokenId, (IntPtr)tokenId.Length,
+ GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
+ }
+
+ public void CallResetPasswordFunction(string username, string password, string functionArgs, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ EmailNativeMethods.call_reset_password_function(_appHandle,
+ username, (IntPtr)username.Length,
+ password, (IntPtr)password.Length,
+ functionArgs, (IntPtr)functionArgs.Length,
+ GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
+ }
+ }
+ }
+}
diff --git a/Realm/Realm/Handles/AppHandle.cs b/Realm/Realm/Handles/AppHandle.cs
new file mode 100644
index 0000000000..cd5fe484c5
--- /dev/null
+++ b/Realm/Realm/Handles/AppHandle.cs
@@ -0,0 +1,380 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using Realms.Native;
+using Realms.Sync.Exceptions;
+using Realms.Sync.Native;
+
+namespace Realms.Sync
+{
+ internal partial class AppHandle : RealmHandle
+ {
+ private static class NativeMethods
+ {
+#pragma warning disable IDE1006 // Naming Styles
+#pragma warning disable SA1121 // Use built-in type alias
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public unsafe delegate void LogMessageCallback(IntPtr managed_handler, byte* message_buf, IntPtr message_len, LogLevel logLevel);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void UserCallback(IntPtr tcs_ptr, IntPtr user_ptr, AppError error);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void VoidTaskCallback(IntPtr tcs_ptr, AppError error);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public unsafe delegate void BsonCallback(IntPtr tcs_ptr, BsonPayload response, AppError error);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_initialize", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr initialize(
+ [MarshalAs(UnmanagedType.LPWStr)] string platform, IntPtr platform_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string platform_version, IntPtr platform_version_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string sdk_version, IntPtr sdk_version_len,
+ UserCallback user_callback, VoidTaskCallback void_callback, BsonCallback bson_callback, LogMessageCallback log_message_callback);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_create", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr create_app(Native.AppConfiguration app_config, byte[] encryptionKey, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_destroy", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void destroy(IntPtr syncuserHandle);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_sync_get_session_from_path", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_session(AppHandle app, SharedRealmHandle realm, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_sync_get_path_for_realm", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_path_for_realm(AppHandle app, SyncUserHandle user, [MarshalAs(UnmanagedType.LPWStr)] string partition, IntPtr partition_len, IntPtr buffer, IntPtr bufsize, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_sync_immediately_run_file_actions", CallingConvention = CallingConvention.Cdecl)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ public static extern bool immediately_run_file_actions(AppHandle app, [MarshalAs(UnmanagedType.LPWStr)] string path, IntPtr path_len, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_sync_reconnect", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void reconnect(AppHandle app);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_get_current_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_current_user(AppHandle app, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_get_logged_in_users", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_logged_in_users(AppHandle app, [Out] IntPtr[] users, IntPtr bufsize, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_switch_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr switch_user(AppHandle app, SyncUserHandle user, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_login_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void login_user(AppHandle app, Native.Credentials credentials, IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_remove_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void remove_user(AppHandle app, SyncUserHandle user, IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_reset_for_testing", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void reset_for_testing(AppHandle app);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_get_user_for_testing", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_user_for_testing(
+ AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string id_buf, IntPtr id_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string refresh_token_buf, IntPtr refresh_token_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string access_token_buf, IntPtr access_token_len,
+ out NativeException ex);
+
+ public static class EmailPassword
+ {
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_register_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void register_user(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string username, IntPtr username_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string password, IntPtr password_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_confirm_user", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void confirm_user(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string token, IntPtr token_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string token_id, IntPtr token_id_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_resend_confirmation_email", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void resent_confirmation_email(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string email, IntPtr email_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_send_reset_password_email", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void send_reset_password_email(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string email, IntPtr email_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_reset_password", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void reset_password(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string password, IntPtr password_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string token, IntPtr token_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string token_id, IntPtr token_id_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_app_email_call_reset_password_function", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void call_reset_password_function(AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string username, IntPtr username_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string password, IntPtr password_len,
+ IntPtr tcs_ptr, out NativeException ex);
+ }
+
+#pragma warning restore IDE1006 // Naming Styles
+#pragma warning restore SA1121 // Use built-in type alias
+ }
+
+ static unsafe AppHandle()
+ {
+ NativeCommon.Initialize();
+ SessionHandle.InstallCallbacks();
+
+ NativeMethods.LogMessageCallback logMessage = HandleLogMessage;
+ NativeMethods.UserCallback userLogin = HandleUserCallback;
+ NativeMethods.VoidTaskCallback taskCallback = HandleTaskCompletion;
+ NativeMethods.BsonCallback bsonCallback = HandleBsonCallback;
+
+ GCHandle.Alloc(logMessage);
+ GCHandle.Alloc(userLogin);
+ GCHandle.Alloc(taskCallback);
+ GCHandle.Alloc(bsonCallback);
+
+ //// This is a hack due to a mixup of what OS uses as platform/SDK and what is displayed in the UI.
+ //// The original code is below:
+ ////
+ //// string platform;
+ //// string platformVersion;
+ //// var platformRegex = new Regex("^(?[^0-9]*) (?[^ ]*)", RegexOptions.Compiled);
+ //// var osDescription = platformRegex.Match(RuntimeInformation.OSDescription);
+ //// if (osDescription.Success)
+ //// {
+ //// platform = osDescription.Groups["platform"].Value;
+ //// platformVersion = osDescription.Groups["version"].Value;
+ //// }
+ //// else
+ //// {
+ //// platform = Environment.OSVersion.Platform.ToString();
+ //// platformVersion = Environment.OSVersion.VersionString;
+ //// }
+
+ var platform = "Realm .NET";
+ var platformVersion = RuntimeInformation.OSDescription;
+
+ var sdkVersion = typeof(AppHandle).GetTypeInfo().Assembly.GetName().Version.ToString(3);
+ NativeMethods.initialize(
+ platform, (IntPtr)platform.Length,
+ platformVersion, (IntPtr)platformVersion.Length,
+ sdkVersion, (IntPtr)sdkVersion.Length,
+ userLogin, taskCallback, bsonCallback, logMessage);
+
+ HttpClientTransport.Install();
+ }
+
+ internal AppHandle(IntPtr handle) : base(null, handle)
+ {
+ EmailPassword = new EmailPasswordApi(this);
+ }
+
+ public static AppHandle CreateApp(Native.AppConfiguration config, byte[] encryptionKey)
+ {
+ var handle = NativeMethods.create_app(config, encryptionKey, out var ex);
+ ex.ThrowIfNecessary();
+ return new AppHandle(handle);
+ }
+
+ public string GetRealmPath(User user, string partition)
+ {
+ return MarshalHelpers.GetString((IntPtr buffer, IntPtr bufferLength, out bool isNull, out NativeException ex) =>
+ {
+ isNull = false;
+ return NativeMethods.get_path_for_realm(this, user.Handle, partition, (IntPtr)partition.Length, buffer, bufferLength, out ex);
+ });
+ }
+
+ public SessionHandle GetSessionForPath(SharedRealmHandle realm)
+ {
+ var ptr = NativeMethods.get_session(this, realm, out var ex);
+ ex.ThrowIfNecessary();
+ return new SessionHandle(ptr);
+ }
+
+ public bool ImmediatelyRunFileActions(string path)
+ {
+ var result = NativeMethods.immediately_run_file_actions(this, path, (IntPtr)path.Length, out var ex);
+ ex.ThrowIfNecessary();
+
+ return result;
+ }
+
+ public void Reconnect()
+ {
+ NativeMethods.reconnect(this);
+ }
+
+ public bool TryGetCurrentUser(out SyncUserHandle handle)
+ {
+ var userPtr = NativeMethods.get_current_user(this, out var ex);
+ ex.ThrowIfNecessary();
+
+ if (userPtr == IntPtr.Zero)
+ {
+ handle = null;
+ return false;
+ }
+
+ handle = new SyncUserHandle(userPtr);
+ return true;
+ }
+
+ public IEnumerable GetAllLoggedInUsers()
+ {
+ return MarshalHelpers.GetCollection((IntPtr[] buf, IntPtr len, out NativeException ex) => NativeMethods.get_logged_in_users(this, buf, len, out ex), bufferSize: 8)
+ .Select(h => new SyncUserHandle(h));
+ }
+
+ public void SwitchUser(SyncUserHandle user)
+ {
+ NativeMethods.switch_user(this, user, out var ex);
+ ex.ThrowIfNecessary();
+ }
+
+ public void LogIn(Native.Credentials credentials, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ NativeMethods.login_user(this, credentials, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
+ }
+
+ public void Remove(SyncUserHandle user, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ NativeMethods.remove_user(this, user, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
+ }
+
+ public void ResetForTesting()
+ {
+ NativeMethods.reset_for_testing(this);
+ }
+
+ public SyncUserHandle GetUserForTesting(string id, string refreshToken, string accessToken)
+ {
+ var result = NativeMethods.get_user_for_testing(
+ this,
+ id, (IntPtr)id.Length,
+ refreshToken, (IntPtr)refreshToken.Length,
+ accessToken, (IntPtr)accessToken.Length,
+ out var ex);
+ ex.ThrowIfNecessary();
+ return new SyncUserHandle(result);
+ }
+
+ protected override void Unbind()
+ {
+ NativeMethods.destroy(handle);
+ }
+
+ [MonoPInvokeCallback(typeof(NativeMethods.LogMessageCallback))]
+ private static unsafe void HandleLogMessage(IntPtr managedHandler, byte* messageBuffer, IntPtr messageLength, LogLevel level)
+ {
+ try
+ {
+ var message = Encoding.UTF8.GetString(messageBuffer, (int)messageLength);
+ var logCallback = (Action)GCHandle.FromIntPtr(managedHandler).Target;
+ logCallback.Invoke(message, level);
+ }
+ catch (Exception ex)
+ {
+ var errorMessage = $"An error occurred while trying to log a message: {ex}";
+ Console.Error.WriteLine(errorMessage);
+ }
+ }
+
+ [MonoPInvokeCallback(typeof(NativeMethods.UserCallback))]
+ [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The user will own its handle.")]
+ private static unsafe void HandleUserCallback(IntPtr tcs_ptr, IntPtr user_ptr, AppError error)
+ {
+ var tcsHandle = GCHandle.FromIntPtr(tcs_ptr);
+ try
+ {
+ var tcs = (TaskCompletionSource)tcsHandle.Target;
+ if (error.is_null)
+ {
+ var userHandle = new SyncUserHandle(user_ptr);
+ tcs.TrySetResult(userHandle);
+ }
+ else
+ {
+ tcs.TrySetException(new AppException(error));
+ }
+ }
+ finally
+ {
+ tcsHandle.Free();
+ }
+ }
+
+ [MonoPInvokeCallback(typeof(NativeMethods.VoidTaskCallback))]
+ private static unsafe void HandleTaskCompletion(IntPtr tcs_ptr, AppError error)
+ {
+ var tcsHandle = GCHandle.FromIntPtr(tcs_ptr);
+ try
+ {
+ var tcs = (TaskCompletionSource)tcsHandle.Target;
+ if (error.is_null)
+ {
+ tcs.TrySetResult(null);
+ }
+ else
+ {
+ tcs.TrySetException(new AppException(error));
+ }
+ }
+ finally
+ {
+ tcsHandle.Free();
+ }
+ }
+
+ [MonoPInvokeCallback(typeof(NativeMethods.BsonCallback))]
+ private static unsafe void HandleBsonCallback(IntPtr tcs_ptr, BsonPayload response, AppError error)
+ {
+ var tcsHandle = GCHandle.FromIntPtr(tcs_ptr);
+ try
+ {
+ var tcs = (TaskCompletionSource)tcsHandle.Target;
+ if (error.is_null)
+ {
+ tcs.TrySetResult(response);
+ }
+ else
+ {
+ tcs.TrySetException(new AppException(error));
+ }
+ }
+ finally
+ {
+ tcsHandle.Free();
+ }
+ }
+ }
+}
diff --git a/Realm/Realm/Handles/CollectionHandleBase.cs b/Realm/Realm/Handles/CollectionHandleBase.cs
index ed9f57eec1..6550045044 100644
--- a/Realm/Realm/Handles/CollectionHandleBase.cs
+++ b/Realm/Realm/Handles/CollectionHandleBase.cs
@@ -50,7 +50,7 @@ public PrimitiveValue GetPrimitiveAtIndex(int index, PropertyType type)
{
var result = new PrimitiveValue
{
- type = type
+ Type = type
};
GetPrimitiveAtIndexCore((IntPtr)index, ref result, out var nativeException);
diff --git a/Realm/Realm/Handles/ListHandle.cs b/Realm/Realm/Handles/ListHandle.cs
index 0a8c3e6f82..eef44fb005 100644
--- a/Realm/Realm/Handles/ListHandle.cs
+++ b/Realm/Realm/Handles/ListHandle.cs
@@ -40,11 +40,14 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_add_string", CallingConvention = CallingConvention.Cdecl)]
public static extern void add_string(ListHandle listHandle, [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLength,
- [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_add_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern void add_binary(ListHandle listHandle, IntPtr buffer, IntPtr bufferLength,
- [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_add_embedded", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr add_embedded(ListHandle listHandle, out NativeException ex);
#endregion
@@ -60,11 +63,14 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_set_string", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_string(ListHandle listHandle, IntPtr targetIndex, [MarshalAs(UnmanagedType.LPWStr)] string value,
- IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_set_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_binary(ListHandle listHandle, IntPtr targetIndex, IntPtr buffer, IntPtr bufferLength,
- [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_set_embedded", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr set_embedded(ListHandle listHandle, IntPtr targetIndex, out NativeException ex);
#endregion
@@ -80,11 +86,14 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_insert_string", CallingConvention = CallingConvention.Cdecl)]
public static extern void insert_string(ListHandle listHandle, IntPtr targetIndex, [MarshalAs(UnmanagedType.LPWStr)] string value,
- IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_insert_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern void insert_binary(ListHandle listHandle, IntPtr targetIndex, IntPtr buffer, IntPtr bufferLength,
- [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_insert_embedded", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr insert_embedded(ListHandle listHandle, IntPtr targetIndex, out NativeException ex);
#endregion
@@ -98,11 +107,11 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_get_string", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_string(ListHandle listHandle, IntPtr link_ndx, IntPtr buffer, IntPtr bufsize,
- [MarshalAs(UnmanagedType.I1)] out bool isNull, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] out bool isNull, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_get_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_binary(ListHandle listHandle, IntPtr link_ndx, IntPtr buffer, IntPtr bufsize,
- [MarshalAs(UnmanagedType.I1)] out bool isNull, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] out bool isNull, out NativeException ex);
#endregion
@@ -118,11 +127,11 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_find_string", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr find_string(ListHandle listHandle, [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen,
- [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_find_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr find_binary(ListHandle listHandle, IntPtr buffer, IntPtr bufsize,
- [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] bool has_value, out NativeException ex);
#endregion
@@ -145,7 +154,7 @@ private static class NativeMethods
public static extern IntPtr move(ListHandle listHandle, IntPtr sourceIndex, IntPtr targetIndex, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_get_is_valid", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool get_is_valid(ListHandle listHandle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_get_thread_safe_reference", CallingConvention = CallingConvention.Cdecl)]
@@ -155,7 +164,7 @@ private static class NativeMethods
public static extern IntPtr snapshot(ListHandle list, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_get_is_frozen", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool get_is_frozen(ListHandle list, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "list_freeze", CallingConvention = CallingConvention.Cdecl)]
@@ -232,6 +241,13 @@ public unsafe void Add(byte[] value)
NativeMethods.add_binary(this, buffer, bufferSize, hasValue, out ex));
}
+ public ObjectHandle AddEmbedded()
+ {
+ var result = NativeMethods.add_embedded(this, out var nativeException);
+ nativeException.ThrowIfNecessary();
+ return new ObjectHandle(Root, result);
+ }
+
#endregion
#region Set
@@ -263,6 +279,13 @@ public unsafe void Set(int targetIndex, byte[] value)
NativeMethods.set_binary(this, (IntPtr)targetIndex, buffer, bufferSize, hasValue, out ex));
}
+ public ObjectHandle SetEmbedded(int targetIndex)
+ {
+ var result = NativeMethods.set_embedded(this, (IntPtr)targetIndex, out var nativeException);
+ nativeException.ThrowIfNecessary();
+ return new ObjectHandle(Root, result);
+ }
+
#endregion
#region Insert
@@ -294,6 +317,13 @@ public unsafe void Insert(int targetIndex, byte[] value)
NativeMethods.insert_binary(this, (IntPtr)targetIndex, buffer, bufferSize, hasValue, out ex));
}
+ public ObjectHandle InsertEmbedded(int targetIndex)
+ {
+ var result = NativeMethods.insert_embedded(this, (IntPtr)targetIndex, out var nativeException);
+ nativeException.ThrowIfNecessary();
+ return new ObjectHandle(Root, result);
+ }
+
#endregion
#region Find
diff --git a/Realm/Realm/Handles/MongoCollectionHandle.cs b/Realm/Realm/Handles/MongoCollectionHandle.cs
new file mode 100644
index 0000000000..cb792e6a78
--- /dev/null
+++ b/Realm/Realm/Handles/MongoCollectionHandle.cs
@@ -0,0 +1,221 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Realms.Native;
+using Realms.Sync;
+
+namespace Realms
+{
+ internal class MongoCollectionHandle : RealmHandle
+ {
+ private static class NativeMethods
+ {
+#pragma warning disable IDE1006 // Naming Styles
+#pragma warning disable SA1121 // Use built-in type alias
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_get", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get(SyncUserHandle user,
+ [MarshalAs(UnmanagedType.LPWStr)] string service, IntPtr service_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string database, IntPtr database_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string collection, IntPtr collection_len,
+ out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_destroy", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void destroy(IntPtr handle);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_find_one", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void find_one(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ FindAndModifyOptions options,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_find", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void find(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ FindAndModifyOptions options,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_aggregate", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void aggregate(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string pipeline, IntPtr pipeline_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_count", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void count(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ Int64 limit,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_insert_one", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void insert_one(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string doc, IntPtr doc_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_insert_many", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void insert_many(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string docs, IntPtr docs_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_delete_one", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void delete_one(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_delete_many", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void delete_many(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_update_one", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void update_one(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string update, IntPtr update_len,
+ [MarshalAs(UnmanagedType.U1)] bool upsert,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_update_many", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void update_many(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string update, IntPtr update_len,
+ [MarshalAs(UnmanagedType.U1)] bool upsert,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_find_one_and_update", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void find_one_and_update(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string update, IntPtr update_len,
+ FindAndModifyOptions options,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_find_one_and_replace", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void find_one_and_replace(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string update, IntPtr update_len,
+ FindAndModifyOptions options,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_mongo_collection_find_one_and_delete", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void find_one_and_delete(MongoCollectionHandle handle,
+ [MarshalAs(UnmanagedType.LPWStr)] string filter, IntPtr filter_len,
+ FindAndModifyOptions options,
+ IntPtr tcs_ptr, out NativeException ex);
+
+#pragma warning restore SA1121 // Use built-in type alias
+#pragma warning restore IDE1006 // Naming Styles
+ }
+
+ private MongoCollectionHandle(SyncUserHandle root, IntPtr handle) : base(root, handle)
+ {
+ }
+
+ public static MongoCollectionHandle Create(SyncUserHandle user, string service, string database, string collection)
+ {
+ var handle = NativeMethods.get(user, service, (IntPtr)service.Length, database, (IntPtr)database.Length, collection, (IntPtr)collection.Length, out var ex);
+ ex.ThrowIfNecessary();
+
+ return new MongoCollectionHandle(user, handle);
+ }
+
+ public Task FindOne(string filter, FindAndModifyOptions options)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.find_one(this, filter, filter.IntPtrLength(), options, tcs, out ex));
+ }
+
+ public Task Find(string filter, FindAndModifyOptions options)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.find(this, filter, filter.IntPtrLength(), options, tcs, out ex));
+ }
+
+ public Task Aggregate(string pipeline)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.aggregate(this, pipeline, pipeline.IntPtrLength(), tcs, out ex));
+ }
+
+ public Task Count(string filter, long? limit)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.count(this, filter, filter.IntPtrLength(), limit ?? 0, tcs, out ex));
+ }
+
+ public Task InsertOne(string doc)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.insert_one(this, doc, doc.IntPtrLength(), tcs, out ex));
+ }
+
+ public Task InsertMany(string docs)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.insert_many(this, docs, docs.IntPtrLength(), tcs, out ex));
+ }
+
+ public Task DeleteOne(string filter)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.delete_one(this, filter, filter.IntPtrLength(), tcs, out ex));
+ }
+
+ public Task DeleteMany(string filter)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.delete_many(this, filter, filter.IntPtrLength(), tcs, out ex));
+ }
+
+ public Task UpdateOne(string filter, string update, bool upsert)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.update_one(this, filter, filter.IntPtrLength(), update, update.IntPtrLength(), upsert, tcs, out ex));
+ }
+
+ public Task UpdateMany(string filter, string update, bool upsert)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) => NativeMethods.update_many(this, filter, filter.IntPtrLength(), update, update.IntPtrLength(), upsert, tcs, out ex));
+ }
+
+ public Task FindOneAndUpdate(string filter, string update, FindAndModifyOptions options)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) =>
+ NativeMethods.find_one_and_update(this, filter, filter.IntPtrLength(), update, update.IntPtrLength(), options, tcs, out ex));
+ }
+
+ public Task FindOneAndReplace(string filter, string replacement, FindAndModifyOptions options)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) =>
+ NativeMethods.find_one_and_replace(this, filter, filter.IntPtrLength(), replacement, replacement.IntPtrLength(), options, tcs, out ex));
+ }
+
+ public Task FindOneAndDelete(string filter, FindAndModifyOptions options)
+ {
+ return CallNativeMethod((IntPtr tcs, out NativeException ex) =>
+ NativeMethods.find_one_and_delete(this, filter, filter.IntPtrLength(), options, tcs, out ex));
+ }
+
+ protected override void Unbind()
+ {
+ NativeMethods.destroy(handle);
+ }
+
+ private delegate void NativeMethod(IntPtr tcsPtr, out NativeException ex);
+
+ private static Task CallNativeMethod(NativeMethod method)
+ {
+ var tcs = new TaskCompletionSource();
+ var tcsHandle = GCHandle.Alloc(tcs);
+ method(GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
+ return tcs.Task;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Realm/Realm/Handles/NotifierHandle.cs b/Realm/Realm/Handles/NotifierHandle.cs
deleted file mode 100644
index a76bfb1ede..0000000000
--- a/Realm/Realm/Handles/NotifierHandle.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2019 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Runtime.InteropServices;
-using System.Threading.Tasks;
-
-using NativeSyncConfiguration = Realms.Sync.Native.SyncConfiguration;
-
-namespace Realms.Server
-{
- internal class NotifierHandle : RealmHandle
- {
- private static class NativeMethods
- {
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public unsafe delegate bool ShouldHandleCallback(IntPtr managedNotifier, byte* path_buf, IntPtr path_len);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public unsafe delegate void EnqueueCalculationCallback(IntPtr managedNotifier, byte* path_buf, IntPtr path_len, IntPtr calculator_ptr);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public unsafe delegate void StartCallback(IntPtr task_completion_source, int error_code, byte* message_buf, IntPtr message_len);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_server_install_callbacks", CallingConvention = CallingConvention.Cdecl)]
- public static extern void install_callbacks(
- ShouldHandleCallback should_handle_callback,
- EnqueueCalculationCallback enqueue_calculation_callback,
- StartCallback start_callback,
- NotifierNotificationHandle.CalculationCompleteCallback calculation_complete_callback);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_server_create_global_notifier", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr create_notifier(IntPtr managedInstance,
- NativeSyncConfiguration sync_configuration,
- byte[] encryptionKey,
- out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_server_global_notifier_get_realm_for_writing", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_realm_for_writing(SharedRealmHandle currentRealm, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_server_global_notifier_destroy", CallingConvention = CallingConvention.Cdecl)]
- public static extern void destroy(IntPtr handle);
- }
-
- static unsafe NotifierHandle()
- {
- NativeCommon.Initialize();
-
- NativeMethods.ShouldHandleCallback shouldHandle = Notifier.ShouldHandle;
- NativeMethods.EnqueueCalculationCallback enqueueCalculation = Notifier.EnqueueCalculation;
- NativeMethods.StartCallback start = Notifier.OnStarted;
- NotifierNotificationHandle.CalculationCompleteCallback calculationComplete = Notifier.OnCalculationCompleted;
-
- GCHandle.Alloc(shouldHandle);
- GCHandle.Alloc(enqueueCalculation);
- GCHandle.Alloc(start);
- GCHandle.Alloc(calculationComplete);
-
- NativeMethods.install_callbacks(shouldHandle, enqueueCalculation, start, calculationComplete);
- }
-
- public static NotifierHandle CreateHandle(GCHandle managedNotifier, NotifierConfiguration configuration)
- {
- var nativeConfig = configuration.ToNative();
- var result = NativeMethods.create_notifier(GCHandle.ToIntPtr(managedNotifier), nativeConfig, configuration.EncryptionKey,
- out var nativeException);
- nativeException.ThrowIfNecessary();
-
- return new NotifierHandle(result);
- }
-
- public static IntPtr GetRealmForWriting(SharedRealmHandle currentRealm)
- {
- var result = NativeMethods.get_realm_for_writing(currentRealm, out var nativeException);
- nativeException.ThrowIfNecessary();
- return result;
- }
-
- protected NotifierHandle(IntPtr handle) : base(null, handle)
- {
- }
-
- protected override void Unbind()
- {
- NativeMethods.destroy(handle);
- }
- }
-}
diff --git a/Realm/Realm/Handles/NotifierNotificationHandle.cs b/Realm/Realm/Handles/NotifierNotificationHandle.cs
deleted file mode 100644
index 475063b24a..0000000000
--- a/Realm/Realm/Handles/NotifierNotificationHandle.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2019 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Runtime.InteropServices;
-using Realms.Server.Native;
-
-namespace Realms.Server
-{
- internal class NotifierNotificationHandle : RealmHandle
- {
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate void CalculationCompleteCallback(IntPtr details, IntPtr managedCallbackPtr);
-
- private static class NativeMethods
- {
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_server_global_notifier_notification_get_changes", CallingConvention = CallingConvention.Cdecl)]
- public static extern void get_changes(NotifierNotificationHandle handle, IntPtr callback, out NativeException nativeException);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_server_global_notifier_notification_destroy", CallingConvention = CallingConvention.Cdecl)]
- public static extern void destroy(IntPtr handle);
- }
-
- public void GetChanges(Action callback)
- {
- var handle = GCHandle.Alloc(callback);
- NativeMethods.get_changes(this, GCHandle.ToIntPtr(handle), out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- internal NotifierNotificationHandle(IntPtr handle) : base(null, handle)
- {
- }
-
- protected override void Unbind()
- {
- NativeMethods.destroy(handle);
- }
- }
-}
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 411907a46d..22e9c2bf04 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -19,7 +19,9 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
+using Realms.Exceptions;
using Realms.Native;
+using Realms.Schema;
namespace Realms
{
@@ -31,7 +33,7 @@ private static class NativeMethods
#pragma warning disable SA1121 // Use built-in type alias
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_is_valid", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool get_is_valid(ObjectHandle objectHandle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_key", CallingConvention = CallingConvention.Cdecl)]
@@ -40,15 +42,13 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_destroy", CallingConvention = CallingConvention.Cdecl)]
public static extern void destroy(IntPtr objectHandle);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_timestamp_ticks", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_timestamp_ticks(ObjectHandle handle, IntPtr propertyIndex, Int64 value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_primitive", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void get_primitive(ObjectHandle handle, IntPtr propertyIndex, ref PrimitiveValue value, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_timestamp_ticks", CallingConvention = CallingConvention.Cdecl)]
- public static extern Int64 get_timestamp_ticks(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_nullable_timestamp_ticks", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool get_nullable_timestamp_ticks(ObjectHandle handle, IntPtr propertyIndex, out Int64 retVal, out NativeException ex);
+ // value is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_primitive", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void set_primitive(ObjectHandle handle, IntPtr propertyIndex, IntPtr value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_string", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_string(ObjectHandle handle, IntPtr propertyIndex,
@@ -56,7 +56,7 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_string", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_string(ObjectHandle handle, IntPtr propertyIndex,
- IntPtr buffer, IntPtr bufsize, [MarshalAs(UnmanagedType.I1)] out bool isNull, out NativeException ex);
+ IntPtr buffer, IntPtr bufsize, [MarshalAs(UnmanagedType.U1)] out bool isNull, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_link", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_link(ObjectHandle handle, IntPtr propertyIndex, ObjectHandle targetHandle, out NativeException ex);
@@ -64,6 +64,9 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_link", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_create_embedded", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr create_embedded_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_clear_link", CallingConvention = CallingConvention.Cdecl)]
public static extern void clear_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
@@ -73,67 +76,26 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_null", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_null(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_bool", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_bool(ObjectHandle handle, IntPtr propertyIndex, [MarshalAs(UnmanagedType.U1)] bool value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_bool", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool get_bool(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_nullable_bool", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool get_nullable_bool(ObjectHandle handle, IntPtr propertyIndex, out IntPtr retVal, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_int64", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_int64(ObjectHandle handle, IntPtr propertyIndex, Int64 value, out NativeException ex);
-
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_add_int64", CallingConvention = CallingConvention.Cdecl)]
public static extern void add_int64(ObjectHandle handle, IntPtr propertyIndex, Int64 value, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_int64", CallingConvention = CallingConvention.Cdecl)]
- public static extern Int64 get_int64(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_nullable_int64", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool get_nullable_int64(ObjectHandle handle, IntPtr propertyIndex, out Int64 retVal, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_float", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_float(ObjectHandle handle, IntPtr propertyIndex, Single value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_float", CallingConvention = CallingConvention.Cdecl)]
- public static extern Single get_float(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_nullable_float", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool get_nullable_float(ObjectHandle handle, IntPtr propertyIndex, out Single retVal, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_double", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_double(ObjectHandle handle, IntPtr propertyIndex, Double value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_double", CallingConvention = CallingConvention.Cdecl)]
- public static extern Double get_double(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_nullable_double", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool get_nullable_double(ObjectHandle handle, IntPtr propertyIndex, out Double retVal, out NativeException ex);
-
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr set_binary(ObjectHandle handle, IntPtr propertyIndex,
IntPtr buffer, IntPtr bufferLength, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_binary(ObjectHandle handle, IntPtr propertyIndex,
- IntPtr buffer, IntPtr bufferLength, [MarshalAs(UnmanagedType.I1)] out bool is_null, out NativeException ex);
+ IntPtr buffer, IntPtr bufferLength, [MarshalAs(UnmanagedType.U1)] out bool is_null, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_remove", CallingConvention = CallingConvention.Cdecl)]
public static extern void remove(ObjectHandle handle, RealmHandle realmHandle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_equals_object", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool equals_object(ObjectHandle handle, ObjectHandle otherHandle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_backlinks", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_backlinks(ObjectHandle objectHandle, IntPtr propertyIndex, out NativeException nativeException);
+ public static extern IntPtr get_backlinks(ObjectHandle objectHandle, IntPtr property_index, out NativeException nativeException);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_backlinks_for_type", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_backlinks_for_type(ObjectHandle objectHandle, TableHandle source_table, IntPtr source_property_index, out NativeException nativeException);
@@ -148,7 +110,7 @@ private static class NativeMethods
public static extern IntPtr get_backlink_count(ObjectHandle objectHandle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_is_frozen", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool get_is_frozen(ObjectHandle objectHandle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_freeze", CallingConvention = CallingConvention.Cdecl)]
@@ -213,41 +175,21 @@ protected override void Unbind()
NativeMethods.destroy(handle);
}
- public void SetDateTimeOffset(IntPtr propertyIndex, DateTimeOffset value)
+ public PrimitiveValue GetPrimitive(IntPtr propertyIndex, PropertyType type)
{
- var ticks = value.ToUniversalTime().Ticks;
- NativeMethods.set_timestamp_ticks(this, propertyIndex, ticks, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void SetNullableDateTimeOffset(IntPtr propertyIndex, DateTimeOffset? value)
- {
- NativeException nativeException;
- if (value.HasValue)
- {
- var ticks = value.Value.ToUniversalTime().Ticks;
- NativeMethods.set_timestamp_ticks(this, propertyIndex, ticks, out nativeException);
- }
- else
- {
- NativeMethods.set_null(this, propertyIndex, out nativeException);
- }
+ var result = new PrimitiveValue { Type = type };
+ NativeMethods.get_primitive(this, propertyIndex, ref result, out var nativeException);
nativeException.ThrowIfNecessary();
- }
- public DateTimeOffset GetDateTimeOffset(IntPtr propertyIndex)
- {
- var ticks = NativeMethods.get_timestamp_ticks(this, propertyIndex, out var nativeException);
- nativeException.ThrowIfNecessary();
- return new DateTimeOffset(ticks, TimeSpan.Zero);
+ return result;
}
- public DateTimeOffset? GetNullableDateTimeOffset(IntPtr propertyIndex)
+ public unsafe void SetPrimitive(IntPtr propertyIndex, PrimitiveValue value)
{
- var hasValue = NativeMethods.get_nullable_timestamp_ticks(this, propertyIndex, out var ticks, out var nativeException);
+ PrimitiveValue* valuePtr = &value;
+ NativeMethods.set_primitive(this, propertyIndex, new IntPtr(valuePtr), out var nativeException);
nativeException.ThrowIfNecessary();
- return hasValue ? new DateTimeOffset(ticks, TimeSpan.Zero) : (DateTimeOffset?)null;
}
public void SetString(IntPtr propertyIndex, string value)
@@ -267,11 +209,6 @@ public void SetString(IntPtr propertyIndex, string value)
public void SetStringUnique(IntPtr propertyIndex, string value)
{
- if (value == null)
- {
- throw new ArgumentNullException(nameof(value), "Object identifiers cannot be null");
- }
-
if (GetString(propertyIndex) != value)
{
throw new InvalidOperationException("Once set, primary key properties may not be modified.");
@@ -317,168 +254,20 @@ public IntPtr GetLinklist(IntPtr propertyIndex)
return result;
}
- public void SetBoolean(IntPtr propertyIndex, bool value)
- {
- NativeMethods.set_bool(this, propertyIndex, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void SetNullableBoolean(IntPtr propertyIndex, bool? value)
- {
- NativeException nativeException;
- if (value.HasValue)
- {
- NativeMethods.set_bool(this, propertyIndex, value.Value, out nativeException);
- }
- else
- {
- NativeMethods.set_null(this, propertyIndex, out nativeException);
- }
-
- nativeException.ThrowIfNecessary();
- }
-
- public bool GetBoolean(IntPtr propertyIndex)
- {
- var result = NativeMethods.get_bool(this, propertyIndex, out var nativeException);
- nativeException.ThrowIfNecessary();
- return result;
- }
-
- public bool? GetNullableBoolean(IntPtr propertyIndex)
- {
- var hasValue = NativeMethods.get_nullable_bool(this, propertyIndex, out var value, out var nativeException);
- nativeException.ThrowIfNecessary();
- return hasValue ? MarshalHelpers.IntPtrToBool(value) : (bool?)null;
- }
-
- public void SetInt64(IntPtr propertyIndex, long value)
- {
- NativeMethods.set_int64(this, propertyIndex, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
public void AddInt64(IntPtr propertyIndex, long value)
{
NativeMethods.add_int64(this, propertyIndex, value, out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void SetNullableInt64(IntPtr propertyIndex, long? value)
- {
- NativeException nativeException;
- if (value.HasValue)
- {
- NativeMethods.set_int64(this, propertyIndex, value.Value, out nativeException);
- }
- else
- {
- NativeMethods.set_null(this, propertyIndex, out nativeException);
- }
-
- nativeException.ThrowIfNecessary();
- }
-
- public void SetInt64Unique(IntPtr propertyIndex, long value)
- {
- if (GetInt64(propertyIndex) != value)
- {
- throw new InvalidOperationException("Once set, primary key properties may not be modified.");
- }
- }
-
- public void SetNullableInt64Unique(IntPtr propertyIndex, long? value)
+ public void SetPrimitiveUnique(IntPtr propertyIndex, PrimitiveValue value)
{
- if (GetNullableInt64(propertyIndex) != value)
+ if (!GetPrimitive(propertyIndex, value.Type).Equals(value))
{
throw new InvalidOperationException("Once set, primary key properties may not be modified.");
}
}
- public long GetInt64(IntPtr propertyIndex)
- {
- var result = NativeMethods.get_int64(this, propertyIndex, out var nativeException);
- nativeException.ThrowIfNecessary();
- return result;
- }
-
- public long? GetNullableInt64(IntPtr propertyIndex)
- {
- var hasValue = NativeMethods.get_nullable_int64(this, propertyIndex, out var value, out var nativeException);
- nativeException.ThrowIfNecessary();
- return hasValue ? value : (long?)null;
- }
-
- public void SetSingle(IntPtr propertyIndex, float value)
- {
- NativeMethods.set_float(this, propertyIndex, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void SetNullableSingle(IntPtr propertyIndex, float? value)
- {
- NativeException nativeException;
- if (value.HasValue)
- {
- NativeMethods.set_float(this, propertyIndex, value.Value, out nativeException);
- }
- else
- {
- NativeMethods.set_null(this, propertyIndex, out nativeException);
- }
-
- nativeException.ThrowIfNecessary();
- }
-
- public float GetSingle(IntPtr propertyIndex)
- {
- var result = NativeMethods.get_float(this, propertyIndex, out var nativeException);
- nativeException.ThrowIfNecessary();
- return result;
- }
-
- public float? GetNullableSingle(IntPtr propertyIndex)
- {
- var hasValue = NativeMethods.get_nullable_float(this, propertyIndex, out var value, out var nativeException);
- nativeException.ThrowIfNecessary();
- return hasValue ? value : (float?)null;
- }
-
- public void SetDouble(IntPtr propertyIndex, double value)
- {
- NativeMethods.set_double(this, propertyIndex, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void SetNullableDouble(IntPtr propertyIndex, double? value)
- {
- NativeException nativeException;
- if (value.HasValue)
- {
- NativeMethods.set_double(this, propertyIndex, value.Value, out nativeException);
- }
- else
- {
- NativeMethods.set_null(this, propertyIndex, out nativeException);
- }
-
- nativeException.ThrowIfNecessary();
- }
-
- public double GetDouble(IntPtr propertyIndex)
- {
- var result = NativeMethods.get_double(this, propertyIndex, out var nativeException);
- nativeException.ThrowIfNecessary();
- return result;
- }
-
- public double? GetNullableDouble(IntPtr propertyIndex)
- {
- var hasValue = NativeMethods.get_nullable_double(this, propertyIndex, out var value, out var nativeException);
- nativeException.ThrowIfNecessary();
- return hasValue ? value : (double?)null;
- }
-
public unsafe void SetByteArray(IntPtr propertyIndex, byte[] value)
{
MarshalHelpers.SetByteArray(value, (IntPtr buffer, IntPtr bufferSize, bool hasValue, out NativeException ex) =>
@@ -508,14 +297,14 @@ public void RemoveFromRealm(SharedRealmHandle realmHandle)
public RealmList GetList(Realm realm, IntPtr propertyIndex, string objectType)
{
- var listHandle = new ListHandle(Root ?? this, GetLinklist(propertyIndex));
+ var listHandle = new ListHandle(Root, GetLinklist(propertyIndex));
var metadata = objectType == null ? null : realm.Metadata[objectType];
return new RealmList(realm, listHandle, metadata);
}
- [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The RealmObject instance will own its handle.")]
+ [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The RealmObjectBase instance will own its handle.")]
public T GetObject(Realm realm, IntPtr propertyIndex, string objectType)
- where T : RealmObject
+ where T : RealmObjectBase
{
if (TryGetLink(propertyIndex, out var objectHandle))
{
@@ -525,21 +314,42 @@ public T GetObject(Realm realm, IntPtr propertyIndex, string objectType)
return null;
}
- public void SetObject(Realm realm, IntPtr propertyIndex, RealmObject @object)
+ public void SetObject(Realm realm, IntPtr propertyIndex, RealmObjectBase @object)
{
if (@object == null)
{
ClearLink(propertyIndex);
}
- else
+ else if (@object is RealmObject realmObj)
+ {
+ if (!realmObj.IsManaged)
+ {
+ realm.Add(realmObj);
+ }
+
+ SetLink(propertyIndex, realmObj.ObjectHandle);
+ }
+ else if (@object is EmbeddedObject embeddedObj)
{
- if (!@object.IsManaged)
+ if (embeddedObj.IsManaged)
{
- realm.Add(@object);
+ throw new RealmException("Can't link to an embedded object that is already managed.");
}
- SetLink(propertyIndex, @object.ObjectHandle);
+ var handle = CreateEmbeddedObjectForProperty(propertyIndex);
+ realm.ManageEmbedded(embeddedObj, handle);
}
+ else
+ {
+ throw new NotSupportedException($"Tried to add an object of type {@object.GetType().FullName} which does not inherit from RealmObject or EmbeddedObject");
+ }
+ }
+
+ public ObjectHandle CreateEmbeddedObjectForProperty(IntPtr propertyIndex)
+ {
+ var objPtr = NativeMethods.create_embedded_link(this, propertyIndex, out var ex);
+ ex.ThrowIfNecessary();
+ return new ObjectHandle(Root, objPtr);
}
public ResultsHandle GetBacklinks(IntPtr propertyIndex)
@@ -552,7 +362,7 @@ public ResultsHandle GetBacklinks(IntPtr propertyIndex)
public ResultsHandle GetBacklinksForType(TableHandle table, IntPtr propertyIndex)
{
- var resultsPtr = NativeMethods.get_backlinks_for_type(this, table, (IntPtr)propertyIndex, out var nativeException);
+ var resultsPtr = NativeMethods.get_backlinks_for_type(this, table, propertyIndex, out var nativeException);
nativeException.ThrowIfNecessary();
return new ResultsHandle(this, resultsPtr);
diff --git a/Realm/Realm/Handles/QueryHandle.cs b/Realm/Realm/Handles/QueryHandle.cs
index 616620c2e0..7e7a71fc18 100644
--- a/Realm/Realm/Handles/QueryHandle.cs
+++ b/Realm/Realm/Handles/QueryHandle.cs
@@ -31,7 +31,7 @@ namespace Realms
internal class QueryHandle : RealmHandle
{
// This is a delegate type meant to represent one of the "query operator" methods such as float_less and bool_equal
- internal delegate void Operation(QueryHandle queryPtr, ColumnKey columnKey, T value);
+ internal delegate void Operation(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr propertyIndex, T value);
private static class NativeMethods
{
@@ -39,143 +39,63 @@ private static class NativeMethods
#pragma warning disable SA1121 // Use built-in type alias
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_binary_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void binary_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr buffer, IntPtr bufferLength, out NativeException ex);
+ public static extern void binary_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr buffer, IntPtr bufferLength, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_binary_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void binary_not_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr buffer, IntPtr bufferLength, out NativeException ex);
+ public static extern void binary_not_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr buffer, IntPtr bufferLength, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_string_contains", CallingConvention = CallingConvention.Cdecl)]
- public static extern void string_contains(QueryHandle queryPtr, ColumnKey columnKey,
- [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
+ public static extern void string_contains(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx,
+ [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool caseSensitive, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_string_starts_with", CallingConvention = CallingConvention.Cdecl)]
- public static extern void string_starts_with(QueryHandle queryPtr, ColumnKey columnKey,
- [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
+ public static extern void string_starts_with(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx,
+ [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool caseSensitive, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_string_ends_with", CallingConvention = CallingConvention.Cdecl)]
- public static extern void string_ends_with(QueryHandle queryPtr, ColumnKey columnKey,
- [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
+ public static extern void string_ends_with(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx,
+ [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool caseSensitive, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_string_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void string_equal(QueryHandle queryPtr, ColumnKey columnKey,
- [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
+ public static extern void string_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx,
+ [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool caseSensitive, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_string_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void string_not_equal(QueryHandle queryPtr, ColumnKey columnKey,
- [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
+ public static extern void string_not_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx,
+ [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool caseSensitive, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_string_like", CallingConvention = CallingConvention.Cdecl)]
- public static extern void string_like(QueryHandle queryPtr, ColumnKey columnKey,
- [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
+ public static extern void string_like(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx,
+ [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.U1)] bool caseSensitive, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_bool_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void bool_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
+ // primitive is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_primitive_equal", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void primitive_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr primitive, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_bool_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void bool_not_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_primitive_not_equal", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void primitive_not_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr primitive, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_int_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void int_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_primitive_less", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void primitive_less(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr primitive, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_int_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void int_not_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_primitive_less_equal", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void primitive_less_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr primitive, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_int_less", CallingConvention = CallingConvention.Cdecl)]
- public static extern void int_less(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_primitive_greater", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void primitive_greater(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr primitive, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_int_less_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void int_less_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_int_greater", CallingConvention = CallingConvention.Cdecl)]
- public static extern void int_greater(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_int_greater_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void int_greater_equal(QueryHandle queryPtr, ColumnKey columnKey, IntPtr value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_long_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void long_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_long_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void long_not_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_long_less", CallingConvention = CallingConvention.Cdecl)]
- public static extern void long_less(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_long_less_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void long_less_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_long_greater", CallingConvention = CallingConvention.Cdecl)]
- public static extern void long_greater(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_long_greater_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void long_greater_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_float_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void float_equal(QueryHandle queryPtr, ColumnKey columnKey, Single value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_float_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void float_not_equal(QueryHandle queryPtr, ColumnKey columnKey, Single value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_float_less", CallingConvention = CallingConvention.Cdecl)]
- public static extern void float_less(QueryHandle queryPtr, ColumnKey columnKey, Single value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_float_less_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void float_less_equal(QueryHandle queryPtr, ColumnKey columnKey, Single value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_float_greater", CallingConvention = CallingConvention.Cdecl)]
- public static extern void float_greater(QueryHandle queryPtr, ColumnKey columnKey, Single value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_float_greater_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void float_greater_equal(QueryHandle queryPtr, ColumnKey columnKey, Single value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_double_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void double_equal(QueryHandle queryPtr, ColumnKey columnKey, Double value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_double_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void double_not_equal(QueryHandle queryPtr, ColumnKey columnKey, Double value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_double_less", CallingConvention = CallingConvention.Cdecl)]
- public static extern void double_less(QueryHandle queryPtr, ColumnKey columnKey, Double value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_double_less_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void double_less_equal(QueryHandle queryPtr, ColumnKey columnKey, Double value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_double_greater", CallingConvention = CallingConvention.Cdecl)]
- public static extern void double_greater(QueryHandle queryPtr, ColumnKey columnKey, Double value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_double_greater_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void double_greater_equal(QueryHandle queryPtr, ColumnKey columnKey, Double value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_timestamp_ticks_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void timestamp_ticks_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_timestamp_ticks_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void timestamp_ticks_not_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_timestamp_ticks_less", CallingConvention = CallingConvention.Cdecl)]
- public static extern void timestamp_ticks_less(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_timestamp_ticks_less_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void timestamp_ticks_less_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_timestamp_ticks_greater", CallingConvention = CallingConvention.Cdecl)]
- public static extern void timestamp_ticks_greater(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_timestamp_ticks_greater_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void timestamp_ticks_greater_equal(QueryHandle queryPtr, ColumnKey columnKey, Int64 value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_primitive_greater_equal", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void primitive_greater_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, IntPtr primitive, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_object_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void query_object_equal(QueryHandle queryPtr, ColumnKey columnKey, ObjectHandle objectHandle, out NativeException ex);
+ public static extern void query_object_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, ObjectHandle objectHandle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_null_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void null_equal(QueryHandle queryPtr, ColumnKey columnKey, out NativeException ex);
+ public static extern void null_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_null_not_equal", CallingConvention = CallingConvention.Cdecl)]
- public static extern void null_not_equal(QueryHandle queryPtr, ColumnKey columnKey, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_get_column_key", CallingConvention = CallingConvention.Cdecl)]
- public static extern void get_column_key(QueryHandle queryPtr,
- [MarshalAs(UnmanagedType.LPWStr)] string columnName, IntPtr columnNameLen, out ColumnKey key, out NativeException ex);
+ public static extern void null_not_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "query_not", CallingConvention = CallingConvention.Cdecl)]
public static extern void not(QueryHandle queryHandle, out NativeException ex);
@@ -211,307 +131,138 @@ protected override void Unbind()
NativeMethods.destroy(handle);
}
- public NumericQueryMethods NumericEqualMethods => new NumericQueryMethods(IntEqual, LongEqual, FloatEqual, DoubleEqual);
-
- public NumericQueryMethods NumericNotEqualMethods => new NumericQueryMethods(IntNotEqual, LongNotEqual, FloatNotEqual, DoubleNotEqual);
-
- public NumericQueryMethods NumericLessMethods => new NumericQueryMethods(IntLess, LongLess, FloatLess, DoubleLess);
-
- public NumericQueryMethods NumericLessEqualMethods => new NumericQueryMethods(IntLessEqual, LongLessEqual, FloatLessEqual, DoubleLessEqual);
-
- public NumericQueryMethods NumericGreaterMethods => new NumericQueryMethods(IntGreater, LongGreater, FloatGreater, DoubleGreater);
-
- public NumericQueryMethods NumericGreaterEqualMethods => new NumericQueryMethods(IntGreaterEqual, LongGreaterEqual, FloatGreaterEqual, DoubleGreaterEqual);
-
- public void BinaryEqual(ColumnKey columnKey, IntPtr buffer, IntPtr bufferLength)
+ public void BinaryEqual(SharedRealmHandle realm, IntPtr propertyIndex, IntPtr buffer, IntPtr bufferLength)
{
- NativeMethods.binary_equal(this, columnKey, buffer, bufferLength, out var nativeException);
+ NativeMethods.binary_equal(this, realm, propertyIndex, buffer, bufferLength, out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void BinaryNotEqual(ColumnKey columnKey, IntPtr buffer, IntPtr bufferLength)
+ public void BinaryNotEqual(SharedRealmHandle realm, IntPtr propertyIndex, IntPtr buffer, IntPtr bufferLength)
{
- NativeMethods.binary_not_equal(this, columnKey, buffer, bufferLength, out var nativeException);
+ NativeMethods.binary_not_equal(this, realm, propertyIndex, buffer, bufferLength, out var nativeException);
nativeException.ThrowIfNecessary();
}
///
/// If the user hasn't specified it, should be caseSensitive=true.
///
- public void StringContains(ColumnKey columnKey, string value, bool caseSensitive)
+ public void StringContains(SharedRealmHandle realm, IntPtr propertyIndex, string value, bool caseSensitive)
{
- NativeMethods.string_contains(this, columnKey, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
+ NativeMethods.string_contains(this, realm, propertyIndex, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
nativeException.ThrowIfNecessary();
}
///
/// If the user hasn't specified it, should be caseSensitive = true .
///
- public void StringStartsWith(ColumnKey columnKey, string value, bool caseSensitive)
+ public void StringStartsWith(SharedRealmHandle realm, IntPtr propertyIndex, string value, bool caseSensitive)
{
- NativeMethods.string_starts_with(this, columnKey, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
+ NativeMethods.string_starts_with(this, realm, propertyIndex, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
nativeException.ThrowIfNecessary();
}
///
/// If the user hasn't specified it, should be caseSensitive = true .
///
- public void StringEndsWith(ColumnKey columnKey, string value, bool caseSensitive)
+ public void StringEndsWith(SharedRealmHandle realm, IntPtr propertyIndex, string value, bool caseSensitive)
{
- NativeMethods.string_ends_with(this, columnKey, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
+ NativeMethods.string_ends_with(this, realm, propertyIndex, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
nativeException.ThrowIfNecessary();
}
///
/// If the user hasn't specified it, should be caseSensitive = true .
///
- public void StringEqual(ColumnKey columnKey, string value, bool caseSensitive)
+ public void StringEqual(SharedRealmHandle realm, IntPtr propertyIndex, string value, bool caseSensitive)
{
- NativeMethods.string_equal(this, columnKey, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
+ NativeMethods.string_equal(this, realm, propertyIndex, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
nativeException.ThrowIfNecessary();
}
///
/// If the user hasn't specified it, should be caseSensitive = true .
///
- public void StringNotEqual(ColumnKey columnKey, string value, bool caseSensitive)
+ public void StringNotEqual(SharedRealmHandle realm, IntPtr propertyIndex, string value, bool caseSensitive)
{
- NativeMethods.string_not_equal(this, columnKey, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
+ NativeMethods.string_not_equal(this, realm, propertyIndex, value, (IntPtr)value.Length, caseSensitive, out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void StringLike(ColumnKey columnKey, string value, bool caseSensitive)
+ public void StringLike(SharedRealmHandle realm, IntPtr propertyIndex, string value, bool caseSensitive)
{
NativeException nativeException;
if (value == null)
{
- NativeMethods.null_equal(this, columnKey, out nativeException);
+ NativeMethods.null_equal(this, realm, propertyIndex, out nativeException);
}
else
{
- NativeMethods.string_like(this, columnKey, value, (IntPtr)value.Length, caseSensitive, out nativeException);
+ NativeMethods.string_like(this, realm, propertyIndex, value, (IntPtr)value.Length, caseSensitive, out nativeException);
}
nativeException.ThrowIfNecessary();
}
- public void BoolEqual(ColumnKey columnKey, bool value)
- {
- NativeMethods.bool_equal(this, columnKey, MarshalHelpers.BoolToIntPtr(value), out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void BoolNotEqual(ColumnKey columnKey, bool value)
- {
- NativeMethods.bool_not_equal(this, columnKey, MarshalHelpers.BoolToIntPtr(value), out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void IntEqual(ColumnKey columnKey, int value)
- {
- NativeMethods.int_equal(this, columnKey, (IntPtr)value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void IntNotEqual(ColumnKey columnKey, int value)
- {
- NativeMethods.int_not_equal(this, columnKey, (IntPtr)value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void IntLess(ColumnKey columnKey, int value)
- {
- NativeMethods.int_less(this, columnKey, (IntPtr)value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void IntLessEqual(ColumnKey columnKey, int value)
- {
- NativeMethods.int_less_equal(this, columnKey, (IntPtr)value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void IntGreater(ColumnKey columnKey, int value)
- {
- NativeMethods.int_greater(this, columnKey, (IntPtr)value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void IntGreaterEqual(ColumnKey columnKey, int value)
- {
- NativeMethods.int_greater_equal(this, columnKey, (IntPtr)value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void LongEqual(ColumnKey columnKey, long value)
- {
- NativeMethods.long_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void LongNotEqual(ColumnKey columnKey, long value)
- {
- NativeMethods.long_not_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void LongLess(ColumnKey columnKey, long value)
- {
- NativeMethods.long_less(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void LongLessEqual(ColumnKey columnKey, long value)
- {
- NativeMethods.long_less_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void LongGreater(ColumnKey columnKey, long value)
- {
- NativeMethods.long_greater(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void LongGreaterEqual(ColumnKey columnKey, long value)
- {
- NativeMethods.long_greater_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void FloatEqual(ColumnKey columnKey, float value)
- {
- NativeMethods.float_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void FloatNotEqual(ColumnKey columnKey, float value)
- {
- NativeMethods.float_not_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void FloatLess(ColumnKey columnKey, float value)
- {
- NativeMethods.float_less(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void FloatLessEqual(ColumnKey columnKey, float value)
- {
- NativeMethods.float_less_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void FloatGreater(ColumnKey columnKey, float value)
- {
- NativeMethods.float_greater(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void FloatGreaterEqual(ColumnKey columnKey, float value)
- {
- NativeMethods.float_greater_equal(this, columnKey, value, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void DoubleEqual(ColumnKey columnKey, double value)
+ public unsafe void PrimitiveEqual(SharedRealmHandle realm, IntPtr propertyIndex, PrimitiveValue value)
{
- NativeMethods.double_equal(this, columnKey, value, out var nativeException);
+ PrimitiveValue* valuePtr = &value;
+ NativeMethods.primitive_equal(this, realm, propertyIndex, new IntPtr(valuePtr), out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void DoubleNotEqual(ColumnKey columnKey, double value)
+ public unsafe void PrimitiveNotEqual(SharedRealmHandle realm, IntPtr propertyIndex, PrimitiveValue value)
{
- NativeMethods.double_not_equal(this, columnKey, value, out var nativeException);
+ PrimitiveValue* valuePtr = &value;
+ NativeMethods.primitive_not_equal(this, realm, propertyIndex, new IntPtr(valuePtr), out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void DoubleLess(ColumnKey columnKey, double value)
+ public unsafe void PrimitiveLess(SharedRealmHandle realm, IntPtr propertyIndex, PrimitiveValue value)
{
- NativeMethods.double_less(this, columnKey, value, out var nativeException);
+ PrimitiveValue* valuePtr = &value;
+ NativeMethods.primitive_less(this, realm, propertyIndex, new IntPtr(valuePtr), out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void DoubleLessEqual(ColumnKey columnKey, double value)
+ public unsafe void PrimitiveLessEqual(SharedRealmHandle realm, IntPtr propertyIndex, PrimitiveValue value)
{
- NativeMethods.double_less_equal(this, columnKey, value, out var nativeException);
+ PrimitiveValue* valuePtr = &value;
+ NativeMethods.primitive_less_equal(this, realm, propertyIndex, new IntPtr(valuePtr), out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void DoubleGreater(ColumnKey columnKey, double value)
+ public unsafe void PrimitiveGreater(SharedRealmHandle realm, IntPtr propertyIndex, PrimitiveValue value)
{
- NativeMethods.double_greater(this, columnKey, value, out var nativeException);
+ PrimitiveValue* valuePtr = &value;
+ NativeMethods.primitive_greater(this, realm, propertyIndex, new IntPtr(valuePtr), out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void DoubleGreaterEqual(ColumnKey columnKey, double value)
+ public unsafe void PrimitiveGreaterEqual(SharedRealmHandle realm, IntPtr propertyIndex, PrimitiveValue value)
{
- NativeMethods.double_greater_equal(this, columnKey, value, out var nativeException);
+ PrimitiveValue* valuePtr = &value;
+ NativeMethods.primitive_greater_equal(this, realm, propertyIndex, new IntPtr(valuePtr), out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void TimestampTicksEqual(ColumnKey columnKey, DateTimeOffset value)
+ public void ObjectEqual(SharedRealmHandle realm, IntPtr propertyIndex, ObjectHandle objectHandle)
{
- NativeMethods.timestamp_ticks_equal(this, columnKey, value.ToUniversalTime().Ticks, out var nativeException);
+ NativeMethods.query_object_equal(this, realm, propertyIndex, objectHandle, out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void TimestampTicksNotEqual(ColumnKey columnKey, DateTimeOffset value)
+ public void NullEqual(SharedRealmHandle realm, IntPtr propertyIndex)
{
- NativeMethods.timestamp_ticks_not_equal(this, columnKey, value.ToUniversalTime().Ticks, out var nativeException);
+ NativeMethods.null_equal(this, realm, propertyIndex, out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void TimestampTicksLess(ColumnKey columnKey, DateTimeOffset value)
+ public void NullNotEqual(SharedRealmHandle realm, IntPtr propertyIndex)
{
- NativeMethods.timestamp_ticks_less(this, columnKey, value.ToUniversalTime().Ticks, out var nativeException);
+ NativeMethods.null_not_equal(this, realm, propertyIndex, out var nativeException);
nativeException.ThrowIfNecessary();
}
- public void TimestampTicksLessEqual(ColumnKey columnKey, DateTimeOffset value)
- {
- NativeMethods.timestamp_ticks_less_equal(this, columnKey, value.ToUniversalTime().Ticks, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void TimestampTicksGreater(ColumnKey columnKey, DateTimeOffset value)
- {
- NativeMethods.timestamp_ticks_greater(this, columnKey, value.ToUniversalTime().Ticks, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void TimestampTicksGreaterEqual(ColumnKey columnKey, DateTimeOffset value)
- {
- NativeMethods.timestamp_ticks_greater_equal(this, columnKey, value.ToUniversalTime().Ticks, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void ObjectEqual(ColumnKey columnKey, ObjectHandle objectHandle)
- {
- NativeMethods.query_object_equal(this, columnKey, objectHandle, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void NullEqual(ColumnKey columnKey)
- {
- NativeMethods.null_equal(this, columnKey, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void NullNotEqual(ColumnKey columnKey)
- {
- NativeMethods.null_not_equal(this, columnKey, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public ColumnKey GetColumnKey(string columnName)
- {
- NativeMethods.get_column_key(this, columnName, (IntPtr)columnName.Length, out var result, out var nativeException);
- nativeException.ThrowIfNecessary();
- return result;
- }
-
public void Not()
{
NativeMethods.not(this, out var nativeException);
@@ -549,25 +300,5 @@ public ResultsHandle CreateResults(SharedRealmHandle sharedRealm, SortDescriptor
nativeException.ThrowIfNecessary();
return new ResultsHandle(sharedRealm, result);
}
-
- public struct NumericQueryMethods
- {
- public readonly Action Int;
-
- public readonly Action Long;
-
- public readonly Action Float;
-
- public readonly Action Double;
-
- public NumericQueryMethods(Action intQuery, Action longQuery,
- Action floatQuery, Action doubleQuery)
- {
- Int = intQuery;
- Long = longQuery;
- Float = floatQuery;
- Double = doubleQuery;
- }
- }
}
}
diff --git a/Realm/Realm/Handles/ResultsHandle.cs b/Realm/Realm/Handles/ResultsHandle.cs
index 4ec658d48c..78ce6da694 100644
--- a/Realm/Realm/Handles/ResultsHandle.cs
+++ b/Realm/Realm/Handles/ResultsHandle.cs
@@ -46,11 +46,11 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "results_get_string", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_string(ResultsHandle results, IntPtr link_ndx, IntPtr buffer, IntPtr bufsize,
- [MarshalAs(UnmanagedType.I1)] out bool isNull, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] out bool isNull, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "results_get_binary", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_binary(ResultsHandle results, IntPtr link_ndx, IntPtr buffer, IntPtr bufsize,
- [MarshalAs(UnmanagedType.I1)] out bool isNull, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] out bool isNull, out NativeException ex);
#endregion
@@ -67,7 +67,7 @@ private static class NativeMethods
public static extern IntPtr get_query(ResultsHandle results, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "results_get_is_valid", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool get_is_valid(ResultsHandle results, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "results_get_thread_safe_reference", CallingConvention = CallingConvention.Cdecl)]
@@ -86,7 +86,7 @@ private static class NativeMethods
public static extern IntPtr get_sort_descriptor(ResultsHandle results, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "results_get_is_frozen", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool get_is_frozen(ResultsHandle results, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "results_freeze", CallingConvention = CallingConvention.Cdecl)]
diff --git a/Realm/Realm/Handles/SessionHandle.cs b/Realm/Realm/Handles/SessionHandle.cs
index 68f5382744..cddb893656 100644
--- a/Realm/Realm/Handles/SessionHandle.cs
+++ b/Realm/Realm/Handles/SessionHandle.cs
@@ -18,7 +18,12 @@
using System;
using System.Runtime.InteropServices;
+using System.Text;
using System.Threading.Tasks;
+using Realms.Exceptions;
+using Realms.Native;
+using Realms.Sync.Exceptions;
+using Realms.Sync.Native;
namespace Realms.Sync
{
@@ -26,27 +31,29 @@ internal class SessionHandle : RealmHandle
{
private static class NativeMethods
{
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_refresh_access_token", CallingConvention = CallingConvention.Cdecl)]
- public static extern void refresh_access_token(SessionHandle session,
- [MarshalAs(UnmanagedType.LPWStr)] string access_token, IntPtr access_token_len,
- [MarshalAs(UnmanagedType.LPWStr)] string server_path, IntPtr server_path_len,
- out NativeException ex);
+#pragma warning disable IDE1006 // Naming Styles
+#pragma warning disable SA1121 // Use built-in type alias
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public unsafe delegate void SessionErrorCallback(IntPtr session_handle_ptr, ErrorCode error_code, byte* message_buf, IntPtr message_len, IntPtr user_info_pairs, int user_info_pairs_len, [MarshalAs(UnmanagedType.U1)] bool is_client_reset);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void SessionProgressCallback(IntPtr progress_token_ptr, ulong transferred_bytes, ulong transferable_bytes);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public unsafe delegate void SessionWaitCallback(IntPtr task_completion_source, int error_code, byte* message_buf, IntPtr message_len);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_install_callbacks", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void install_syncsession_callbacks(SessionErrorCallback error_callback, SessionProgressCallback progress_callback, SessionWaitCallback wait_callback);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_get_user", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_user(SessionHandle session);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_get_uri", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_uri(SessionHandle session, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
-
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_get_state", CallingConvention = CallingConvention.Cdecl)]
public static extern SessionState get_state(SessionHandle session, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_get_path", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_path(SessionHandle session, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_get_from_path", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_from_path([MarshalAs(UnmanagedType.LPWStr)] string path, IntPtr path_len, out NativeException ex);
-
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_get_raw_pointer", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_raw_pointer(SessionHandle session);
@@ -57,18 +64,18 @@ private static class NativeMethods
public static extern ulong register_progress_notifier(SessionHandle session,
IntPtr token_ptr,
ProgressDirection direction,
- [MarshalAs(UnmanagedType.I1)] bool is_streaming,
+ [MarshalAs(UnmanagedType.U1)] bool is_streaming,
out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_unregister_progress_notifier", CallingConvention = CallingConvention.Cdecl)]
public static extern void unregister_progress_notifier(SessionHandle session, ulong token, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_wait", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern void wait(SessionHandle session, IntPtr task_completion_source, ProgressDirection direction, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_report_error_for_testing", CallingConvention = CallingConvention.Cdecl)]
- public static extern void report_error_for_testing(SessionHandle session, int error_code, [MarshalAs(UnmanagedType.LPWStr)] string message, IntPtr message_len, [MarshalAs(UnmanagedType.I1)] bool is_fatal);
+ public static extern void report_error_for_testing(SessionHandle session, int error_code, [MarshalAs(UnmanagedType.LPWStr)] string message, IntPtr message_len, [MarshalAs(UnmanagedType.U1)] bool is_fatal);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_stop", CallingConvention = CallingConvention.Cdecl)]
public static extern void stop(SessionHandle session, out NativeException ex);
@@ -76,11 +83,8 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_start", CallingConvention = CallingConvention.Cdecl)]
public static extern void start(SessionHandle session, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_set_multiplex_identifier", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_multiplex_identifier(SessionHandle session, [MarshalAs(UnmanagedType.LPWStr)] string identifier, IntPtr identifier_len, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncsession_set_url_prefix", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_url_prefix(SessionHandle session, [MarshalAs(UnmanagedType.LPWStr)] string prefix, IntPtr prefix_len, out NativeException ex);
+#pragma warning restore IDE1006 // Naming Styles
+#pragma warning restore SA1121 // Use built-in type alias
}
static SessionHandle()
@@ -93,6 +97,19 @@ public SessionHandle(IntPtr handle) : base(null, handle)
{
}
+ public static unsafe void InstallCallbacks()
+ {
+ NativeMethods.SessionErrorCallback error = HandleSessionError;
+ NativeMethods.SessionProgressCallback progress = HandleSessionProgress;
+ NativeMethods.SessionWaitCallback wait = HandleSessionWaitCallback;
+
+ GCHandle.Alloc(error);
+ GCHandle.Alloc(progress);
+ GCHandle.Alloc(wait);
+
+ NativeMethods.install_syncsession_callbacks(error, progress, wait);
+ }
+
public bool TryGetUser(out SyncUserHandle handle)
{
var ptr = NativeMethods.get_user(this);
@@ -106,15 +123,6 @@ public bool TryGetUser(out SyncUserHandle handle)
return true;
}
- public string GetServerUri()
- {
- return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
- {
- isNull = false;
- return NativeMethods.get_uri(this, buffer, length, out ex);
- });
- }
-
public SessionState GetState()
{
var state = NativeMethods.get_state(this, out var ex);
@@ -131,24 +139,6 @@ public string GetPath()
});
}
- public void SetMultiplexIdentifier(string multiplexIdentifier)
- {
- NativeMethods.set_multiplex_identifier(this, multiplexIdentifier, (IntPtr)multiplexIdentifier.Length, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void SetUrlPrefix(string urlPrefix)
- {
- NativeMethods.set_url_prefix(this, urlPrefix, (IntPtr)urlPrefix.Length, out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public void RefreshAccessToken(string accessToken, string serverPath)
- {
- NativeMethods.refresh_access_token(this, accessToken, (IntPtr)accessToken.Length, serverPath, (IntPtr)serverPath.Length, out var ex);
- ex.ThrowIfNecessary();
- }
-
public ulong RegisterProgressNotifier(GCHandle managedHandle, ProgressDirection direction, ProgressMode mode)
{
var isStreaming = mode == ProgressMode.ReportIndefinitely;
@@ -192,16 +182,68 @@ public void Start()
ex.ThrowIfNecessary();
}
- public static SessionHandle GetSessionForPath(string path)
+ protected override void Unbind()
{
- var ptr = NativeMethods.get_from_path(path, (IntPtr)path.Length, out var ex);
- ex.ThrowIfNecessary();
- return new SessionHandle(ptr);
+ NativeMethods.destroy(handle);
}
- protected override void Unbind()
+ [MonoPInvokeCallback(typeof(NativeMethods.SessionErrorCallback))]
+ private static unsafe void HandleSessionError(IntPtr sessionHandlePtr, ErrorCode errorCode, byte* messageBuffer, IntPtr messageLength, IntPtr userInfoPairs, int userInfoPairsLength, bool isClientReset)
{
- NativeMethods.destroy(handle);
+ var handle = new SessionHandle(sessionHandlePtr);
+ var session = new Session(handle);
+ var message = Encoding.UTF8.GetString(messageBuffer, (int)messageLength);
+
+ SessionException exception;
+
+ if (isClientReset)
+ {
+ var userInfo = StringStringPair.UnmarshalDictionary(userInfoPairs, userInfoPairsLength);
+ exception = new ClientResetException(session.User.App, message, userInfo);
+ }
+ else if (errorCode == ErrorCode.PermissionDenied)
+ {
+ var userInfo = StringStringPair.UnmarshalDictionary(userInfoPairs, userInfoPairsLength);
+ exception = new PermissionDeniedException(session.User.App, message, userInfo);
+ }
+ else
+ {
+ exception = new SessionException(message, errorCode);
+ }
+
+ Session.RaiseError(session, exception);
+ }
+
+ [MonoPInvokeCallback(typeof(NativeMethods.SessionProgressCallback))]
+ private static void HandleSessionProgress(IntPtr tokenPtr, ulong transferredBytes, ulong transferableBytes)
+ {
+ var token = (ProgressNotificationToken)GCHandle.FromIntPtr(tokenPtr).Target;
+ token.Notify(transferredBytes, transferableBytes);
+ }
+
+ [MonoPInvokeCallback(typeof(NativeMethods.SessionWaitCallback))]
+ private static unsafe void HandleSessionWaitCallback(IntPtr taskCompletionSource, int error_code, byte* messageBuffer, IntPtr messageLength)
+ {
+ var handle = GCHandle.FromIntPtr(taskCompletionSource);
+ var tcs = (TaskCompletionSource)handle.Target;
+
+ try
+ {
+ if (error_code == 0)
+ {
+ tcs.TrySetResult(null);
+ }
+ else
+ {
+ var inner = new SessionException(Encoding.UTF8.GetString(messageBuffer, (int)messageLength), (ErrorCode)error_code);
+ const string OuterMessage = "A system error occurred while waiting for completion. See InnerException for more details";
+ tcs.TrySetException(new RealmException(OuterMessage, inner));
+ }
+ }
+ finally
+ {
+ handle.Free();
+ }
}
}
}
diff --git a/Realm/Realm/Handles/SharedRealmHandle.cs b/Realm/Realm/Handles/SharedRealmHandle.cs
index 06a08b1e4a..7c01221d48 100644
--- a/Realm/Realm/Handles/SharedRealmHandle.cs
+++ b/Realm/Realm/Handles/SharedRealmHandle.cs
@@ -18,11 +18,16 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using MongoDB.Bson;
using Realms.Exceptions;
using Realms.Native;
using Realms.Schema;
+using Realms.Sync.Exceptions;
namespace Realms
{
@@ -39,6 +44,9 @@ private static class NativeMethods
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void GetNativeSchemaCallback(Native.Schema schema, IntPtr managed_callback);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public unsafe delegate void OpenRealmCallback(IntPtr task_completion_source, IntPtr shared_realm, int error_code, byte* message_buf, IntPtr message_len);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_open", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr open(Configuration configuration,
[MarshalAs(UnmanagedType.LPArray), In] SchemaObject[] objects, int objects_length,
@@ -46,6 +54,21 @@ private static class NativeMethods
byte[] encryptionKey,
out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_open_with_sync", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr open_with_sync(Configuration configuration, Sync.Native.SyncConfiguration sync_configuration,
+ [MarshalAs(UnmanagedType.LPArray), In] SchemaObject[] objects, int objects_length,
+ [MarshalAs(UnmanagedType.LPArray), In] SchemaProperty[] properties,
+ byte[] encryptionKey,
+ out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_open_with_sync_async", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr open_with_sync_async(Configuration configuration, Sync.Native.SyncConfiguration sync_configuration,
+ [MarshalAs(UnmanagedType.LPArray), In] SchemaObject[] objects, int objects_length,
+ [MarshalAs(UnmanagedType.LPArray), In] SchemaProperty[] properties,
+ byte[] encryptionKey,
+ IntPtr task_completion_source,
+ out NativeException ex);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_set_managed_state_handle", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_managed_state_handle(SharedRealmHandle sharedRealm, IntPtr managedStateHandle, out NativeException ex);
@@ -68,25 +91,25 @@ private static class NativeMethods
public static extern void cancel_transaction(SharedRealmHandle sharedRealm, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_is_in_transaction", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool is_in_transaction(SharedRealmHandle sharedRealm, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_refresh", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool refresh(SharedRealmHandle sharedRealm, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_get_table", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_table(SharedRealmHandle sharedRealm, [MarshalAs(UnmanagedType.LPWStr)] string tableName, IntPtr tableNameLength, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_is_same_instance", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool is_same_instance(SharedRealmHandle lhs, SharedRealmHandle rhs, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_get_schema_version", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong get_schema_version(SharedRealmHandle sharedRealm, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_compact", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool compact(SharedRealmHandle sharedRealm, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_resolve_object_reference", CallingConvention = CallingConvention.Cdecl)]
@@ -107,30 +130,31 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_create_object", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_object(SharedRealmHandle sharedRealm, TableHandle table, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_create_object_int_unique", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr create_object_unique(SharedRealmHandle sharedRealm, TableHandle table, long key, [MarshalAs(UnmanagedType.I1)] bool has_value,
- [MarshalAs(UnmanagedType.I1)] bool is_nullable,
- [MarshalAs(UnmanagedType.I1)] bool update,
- [MarshalAs(UnmanagedType.I1)] out bool is_new, out NativeException ex);
+ // value is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_create_object_primitive_unique", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr create_object_unique(SharedRealmHandle sharedRealm, TableHandle table, IntPtr value,
+ [MarshalAs(UnmanagedType.U1)] bool update,
+ [MarshalAs(UnmanagedType.U1)] out bool is_new, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_create_object_string_unique", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_object_unique(SharedRealmHandle sharedRealm, TableHandle table,
[MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen,
- [MarshalAs(UnmanagedType.I1)] bool update,
- [MarshalAs(UnmanagedType.I1)] out bool is_new, out NativeException ex);
+ [MarshalAs(UnmanagedType.U1)] bool update,
+ [MarshalAs(UnmanagedType.U1)] out bool is_new, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_get_schema", CallingConvention = CallingConvention.Cdecl)]
public static extern void get_schema(SharedRealmHandle sharedRealm, IntPtr callback, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_install_callbacks", CallingConvention = CallingConvention.Cdecl)]
- public static extern void install_callbacks(NotifyRealmCallback notifyRealmCallback, GetNativeSchemaCallback nativeSchemaCallback);
+ public static extern void install_callbacks(NotifyRealmCallback notifyRealmCallback, GetNativeSchemaCallback nativeSchemaCallback, OpenRealmCallback open_callback);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_has_changed", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool has_changed(SharedRealmHandle sharedRealm);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_get_is_frozen", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
public static extern bool get_is_frozen(SharedRealmHandle sharedRealm, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_freeze", CallingConvention = CallingConvention.Cdecl)]
@@ -140,17 +164,19 @@ private static class NativeMethods
#pragma warning restore SA1121 // Use built-in type alias
}
- static SharedRealmHandle()
+ 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);
+ NativeMethods.install_callbacks(notifyRealm, getNativeSchema, openRealm);
}
[Preserve]
@@ -172,6 +198,26 @@ public static IntPtr Open(Configuration configuration, RealmSchema schema, byte[
return result;
}
+ public static SharedRealmHandle OpenWithSync(Configuration configuration, Sync.Native.SyncConfiguration syncConfiguration, RealmSchema schema, byte[] encryptionKey)
+ {
+ var marshaledSchema = new SchemaMarshaler(schema);
+
+ var result = NativeMethods.open_with_sync(configuration, syncConfiguration, marshaledSchema.Objects, marshaledSchema.Objects.Length, marshaledSchema.Properties, encryptionKey, out var nativeException);
+ nativeException.ThrowIfNecessary();
+
+ return new SharedRealmHandle(result);
+ }
+
+ public static AsyncOpenTaskHandle OpenWithSyncAsync(Configuration configuration, Sync.Native.SyncConfiguration syncConfiguration, RealmSchema schema, byte[] encryptionKey, GCHandle tcsHandle)
+ {
+ var marshaledSchema = new SchemaMarshaler(schema);
+
+ var asyncTaskPtr = NativeMethods.open_with_sync_async(configuration, syncConfiguration, marshaledSchema.Objects, marshaledSchema.Objects.Length, marshaledSchema.Properties, encryptionKey, GCHandle.ToIntPtr(tcsHandle), out var nativeException);
+ nativeException.ThrowIfNecessary();
+ var asyncTaskHandle = new AsyncOpenTaskHandle(asyncTaskPtr);
+ return asyncTaskHandle;
+ }
+
public static IntPtr ResolveFromReference(ThreadSafeReferenceHandle referenceHandle)
{
var result = NativeMethods.resolve_realm_reference(referenceHandle, out var nativeException);
@@ -322,26 +368,48 @@ public ObjectHandle CreateObject(TableHandle table)
return new ObjectHandle(this, result);
}
- public ObjectHandle CreateObjectWithPrimaryKey(Property pkProperty, object primaryKey, TableHandle table, string parentType, bool update, out bool isNew)
+ public unsafe ObjectHandle CreateObjectWithPrimaryKey(Property pkProperty, object primaryKey, TableHandle table, string parentType, bool update, out bool isNew)
{
if (primaryKey == null && !pkProperty.Type.IsNullable())
{
throw new ArgumentException($"{parentType}'s primary key is defined as non-nullable, but the value passed is null");
}
- switch (pkProperty.Type.UnderlyingType())
+ PrimitiveValue primitiveValue;
+
+ switch (pkProperty.Type)
{
case PropertyType.String:
+ case PropertyType.String | PropertyType.Nullable:
var stringKey = (string)primaryKey;
- return CreateObjectWithPrimaryKey(table, stringKey, update, out isNew);
+ var handle = NativeMethods.create_object_unique(this, table, stringKey, (IntPtr)(stringKey?.Length ?? 0), update, out isNew, out var nativeEx);
+ nativeEx.ThrowIfNecessary();
+ return new ObjectHandle(this, handle);
case PropertyType.Int:
- var longKey = primaryKey == null ? (long?)null : Convert.ToInt64(primaryKey);
- return CreateObjectWithPrimaryKey(table, longKey, pkProperty.Type.IsNullable(), update, out isNew);
+ primitiveValue = PrimitiveValue.Int(Convert.ToInt64(primaryKey));
+ break;
+
+ case PropertyType.NullableInt:
+ primitiveValue = PrimitiveValue.NullableInt(primaryKey == null ? (long?)null : Convert.ToInt64(primaryKey));
+ break;
+
+ case PropertyType.ObjectId:
+ primitiveValue = PrimitiveValue.ObjectId((ObjectId)primaryKey);
+ break;
+
+ case PropertyType.NullableObjectId:
+ primitiveValue = PrimitiveValue.NullableObjectId(primaryKey == null ? (ObjectId?)null : (ObjectId)primaryKey);
+ break;
default:
throw new NotSupportedException($"Unexpected primary key of type: {pkProperty.Type}");
}
+
+ PrimitiveValue* valuePtr = &primitiveValue;
+ var result = NativeMethods.create_object_unique(this, table, new IntPtr(valuePtr), update, out isNew, out var ex);
+ ex.ThrowIfNecessary();
+ return new ObjectHandle(this, result);
}
public bool HasChanged()
@@ -356,20 +424,6 @@ public SharedRealmHandle Freeze()
return new SharedRealmHandle(result);
}
- private ObjectHandle CreateObjectWithPrimaryKey(TableHandle table, long? key, bool isNullable, bool update, out bool isNew)
- {
- var result = NativeMethods.create_object_unique(this, table, key ?? 0, key.HasValue, isNullable, update, out isNew, out var ex);
- ex.ThrowIfNecessary();
- return new ObjectHandle(this, result);
- }
-
- private ObjectHandle CreateObjectWithPrimaryKey(TableHandle table, string key, bool update, out bool isNew)
- {
- var result = NativeMethods.create_object_unique(this, table, key, (IntPtr)(key?.Length ?? 0), update, out isNew, out var ex);
- ex.ThrowIfNecessary();
- return new ObjectHandle(this, result);
- }
-
[MonoPInvokeCallback(typeof(NativeMethods.GetNativeSchemaCallback))]
private static void GetNativeSchema(Native.Schema schema, IntPtr managedCallbackPtr)
{
@@ -386,6 +440,25 @@ public static void NotifyRealmChanged(IntPtr stateHandle)
((Realm.State)gch.Target).NotifyChanged(EventArgs.Empty);
}
+ [MonoPInvokeCallback(typeof(NativeMethods.OpenRealmCallback))]
+ [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The task awaiter will own the ThreadSafeReference handle.")]
+ private static unsafe void HandleOpenRealmCallback(IntPtr taskCompletionSource, IntPtr realm_reference, int error_code, byte* messageBuffer, IntPtr messageLength)
+ {
+ var handle = GCHandle.FromIntPtr(taskCompletionSource);
+ var tcs = (TaskCompletionSource)handle.Target;
+
+ if (error_code == 0)
+ {
+ tcs.TrySetResult(new ThreadSafeReferenceHandle(realm_reference, isRealmReference: true));
+ }
+ else
+ {
+ var inner = new SessionException(Encoding.UTF8.GetString(messageBuffer, (int)messageLength), (ErrorCode)error_code);
+ const string OuterMessage = "A system error occurred while opening a Realm. See InnerException for more details";
+ tcs.TrySetException(new RealmException(OuterMessage, inner));
+ }
+ }
+
public class SchemaMarshaler
{
public readonly SchemaObject[] Objects;
@@ -405,7 +478,8 @@ public SchemaMarshaler(RealmSchema schema)
{
name = @object.Name,
properties_start = start,
- properties_end = properties.Count
+ properties_end = properties.Count,
+ is_embedded = @object.IsEmbedded,
};
}).ToArray();
Properties = properties.ToArray();
diff --git a/Realm/Realm/Handles/SharedRealmHandleExtensions.cs b/Realm/Realm/Handles/SharedRealmHandleExtensions.cs
deleted file mode 100644
index 573c87a7c5..0000000000
--- a/Realm/Realm/Handles/SharedRealmHandleExtensions.cs
+++ /dev/null
@@ -1,441 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Realms.Exceptions;
-using Realms.Native;
-using Realms.Schema;
-using Realms.Sync.Exceptions;
-using Realms.Sync.Native;
-
-namespace Realms.Sync
-{
- internal static class SharedRealmHandleExtensions
- {
- // We only save it to avoid allocating the GCHandle multiple times.
- private static readonly NativeMethods.LogMessageCallback _logCallback;
-
- // This is int, because Interlocked.Exchange cannot work with narrower types such as bool.
- private static int _metadataConfigured;
-
- public static bool IsMetadataConfigured => _metadataConfigured == 1;
-
- private static class NativeMethods
- {
-#pragma warning disable IDE1006 // Naming Styles
-#pragma warning disable SA1121 // Use built-in type alias
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_open_with_sync", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr open_with_sync(Configuration configuration, SyncConfiguration sync_configuration,
- [MarshalAs(UnmanagedType.LPArray), In] SchemaObject[] objects, int objects_length,
- [MarshalAs(UnmanagedType.LPArray), In] SchemaProperty[] properties,
- byte[] encryptionKey,
- out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_open_with_sync_async", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr open_with_sync_async(Configuration configuration, SyncConfiguration sync_configuration,
- [MarshalAs(UnmanagedType.LPArray), In] SchemaObject[] objects, int objects_length,
- [MarshalAs(UnmanagedType.LPArray), In] SchemaProperty[] properties,
- byte[] encryptionKey,
- IntPtr task_completion_source,
- out NativeException ex);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate void RefreshAccessTokenCallbackDelegate(IntPtr session_handle_ptr);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public unsafe delegate void SessionErrorCallback(IntPtr session_handle_ptr, ErrorCode error_code, byte* message_buf, IntPtr message_len, IntPtr user_info_pairs, int user_info_pairs_len);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate void SessionProgressCallback(IntPtr progress_token_ptr, ulong transferred_bytes, ulong transferable_bytes);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public unsafe delegate void SessionWaitCallback(IntPtr task_completion_source, int error_code, byte* message_buf, IntPtr message_len);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public unsafe delegate void LogMessageCallback(byte* message_buf, IntPtr message_len, LogLevel logLevel);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public unsafe delegate void OpenRealmCallback(IntPtr task_completion_source, IntPtr shared_realm, int error_code, byte* message_buf, IntPtr message_len);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_configure", CallingConvention = CallingConvention.Cdecl)]
- public static extern unsafe void configure([MarshalAs(UnmanagedType.LPWStr)] string base_path, IntPtr base_path_length,
- [MarshalAs(UnmanagedType.LPWStr)] string user_agent, IntPtr user_agent_length,
- UserPersistenceMode* userPersistence, byte[] encryptionKey,
- [MarshalAs(UnmanagedType.I1)] bool resetMetadataOnError,
- out NativeException exception);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_install_syncmanager_callbacks", CallingConvention = CallingConvention.Cdecl)]
- public static extern void install_syncmanager_callbacks(OpenRealmCallback open_callback);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_install_syncsession_callbacks", CallingConvention = CallingConvention.Cdecl)]
- public static extern void install_syncsession_callbacks(RefreshAccessTokenCallbackDelegate refresh_callback, SessionErrorCallback error_callback, SessionProgressCallback progress_callback, SessionWaitCallback wait_callback);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_get_path_for_realm", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_path_for_realm(SyncUserHandle user, [MarshalAs(UnmanagedType.LPWStr)] string url, IntPtr url_len, IntPtr buffer, IntPtr bufsize, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_immediately_run_file_actions", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool immediately_run_file_actions([MarshalAs(UnmanagedType.LPWStr)] string path, IntPtr path_len, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_reconnect", CallingConvention = CallingConvention.Cdecl)]
- public static extern void reconnect();
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_get_session", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_session([MarshalAs(UnmanagedType.LPWStr)] string path, IntPtr path_len, SyncConfiguration configuration, byte[] encryptionKey, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_set_log_level", CallingConvention = CallingConvention.Cdecl)]
- public static extern unsafe void set_log_level(LogLevel* level, out NativeException exception);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_set_user_agent", CallingConvention = CallingConvention.Cdecl)]
- public static extern unsafe void set_user_agent([MarshalAs(UnmanagedType.LPWStr)] string user_agent, IntPtr user_agent_length, out NativeException exception);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_get_log_level", CallingConvention = CallingConvention.Cdecl)]
- public static extern LogLevel get_log_level();
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_set_log_callback", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_log_callback(LogMessageCallback callback, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_get_realm_privileges", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.U1)]
- public static extern byte get_realm_privileges(SharedRealmHandle handle, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_get_class_privileges", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.U1)]
- public static extern byte get_class_privileges(SharedRealmHandle handle,
- [MarshalAs(UnmanagedType.LPWStr)] string class_name, IntPtr class_name_len,
- out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_get_object_privileges", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.U1)]
- public static extern byte get_object_privileges(SharedRealmHandle handle, ObjectHandle objectHandle, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncmanager_enable_session_multiplexing", CallingConvention = CallingConvention.Cdecl)]
- public static extern void enable_session_multiplexing(out NativeException ex);
-
-#pragma warning restore IDE1006 // Naming Styles
-#pragma warning restore SA1121 // Use built-in type alias
- }
-
- 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);
- }
-
- public static SharedRealmHandle OpenWithSync(Configuration configuration, SyncConfiguration syncConfiguration, RealmSchema schema, byte[] encryptionKey)
- {
- DoInitialMetadataConfiguration();
-
- var marshaledSchema = new SharedRealmHandle.SchemaMarshaler(schema);
-
- var result = NativeMethods.open_with_sync(configuration, syncConfiguration, marshaledSchema.Objects, marshaledSchema.Objects.Length, marshaledSchema.Properties, encryptionKey, out var nativeException);
- nativeException.ThrowIfNecessary();
-
- return new SharedRealmHandle(result);
- }
-
- public static AsyncOpenTaskHandle OpenWithSyncAsync(Configuration configuration, SyncConfiguration syncConfiguration, RealmSchema schema, byte[] encryptionKey, GCHandle tcsHandle)
- {
- DoInitialMetadataConfiguration();
-
- var marshaledSchema = new SharedRealmHandle.SchemaMarshaler(schema);
-
- var asyncTaskPtr = NativeMethods.open_with_sync_async(configuration, syncConfiguration, marshaledSchema.Objects, marshaledSchema.Objects.Length, marshaledSchema.Properties, encryptionKey, GCHandle.ToIntPtr(tcsHandle), out var nativeException);
- nativeException.ThrowIfNecessary();
- var asyncTaskHandle = new AsyncOpenTaskHandle(asyncTaskPtr);
- return asyncTaskHandle;
- }
-
- public static string GetRealmPath(User user, Uri serverUri)
- {
- DoInitialMetadataConfiguration();
- return MarshalHelpers.GetString((IntPtr buffer, IntPtr bufferLength, out bool isNull, out NativeException ex) =>
- {
- isNull = false;
- return NativeMethods.get_path_for_realm(user.Handle, serverUri.AbsoluteUri, (IntPtr)serverUri.AbsoluteUri.Length, buffer, bufferLength, out ex);
- });
- }
-
- // Configure the SyncMetadataManager with default values if it hasn't been configured already
- public static void DoInitialMetadataConfiguration()
- {
- if (Interlocked.Exchange(ref _metadataConfigured, 1) == 0)
- {
- Configure(null, null, false);
- }
- }
-
- public static void EnableSessionMultiplexing()
- {
- NativeMethods.enable_session_multiplexing(out var nativeException);
- nativeException.ThrowIfNecessary();
- }
-
- public static unsafe void Configure(UserPersistenceMode? userPersistenceMode, byte[] encryptionKey, bool resetMetadataOnError, string basePath = null)
- {
- // mark the file system as configured in case this is called directly
- // so that it isn't reconfigured with default values in DoInitialMetadataConfiguration
- Interlocked.Exchange(ref _metadataConfigured, 1);
-
- RealmException.AddOverrider(RealmExceptionCodes.RealmIncompatibleSyncedFile, (message, path) => new IncompatibleSyncedFileException(message, path));
-
- if (basePath == null)
- {
- basePath = InteropConfig.DefaultStorageFolder;
- }
-
- UserPersistenceMode mode;
- UserPersistenceMode* modePtr = null;
- if (userPersistenceMode.HasValue)
- {
- mode = userPersistenceMode.Value;
- modePtr = &mode;
- }
-
- var userAgent = SyncConfigurationBase.GetSDKUserAgent();
- NativeMethods.configure(
- basePath, (IntPtr)basePath.Length,
- userAgent, (IntPtr)userAgent.Length,
- modePtr, encryptionKey, resetMetadataOnError, out var ex);
- ex.ThrowIfNecessary();
-
- InstallLogCallback();
- }
-
- public static unsafe void SetLogLevel(LogLevel level)
- {
- var levelPtr = &level;
-
- NativeMethods.set_log_level(levelPtr, out var ex);
- ex.ThrowIfNecessary();
- }
-
- public static void SetUserAgent(string userAgent)
- {
- NativeMethods.set_user_agent(userAgent, (IntPtr)userAgent.Length, out var ex);
- ex.ThrowIfNecessary();
- }
-
- public static LogLevel GetLogLevel()
- {
- return NativeMethods.get_log_level();
- }
-
- public static void InstallLogCallback()
- {
- if (SyncConfigurationBase.CustomLogger != null)
- {
- NativeMethods.set_log_callback(_logCallback, out var ex);
- ex.ThrowIfNecessary();
- }
- }
-
- public static void ResetForTesting()
- {
- NativeCommon.reset_for_testing();
- _metadataConfigured = 0;
- }
-
- public static bool ImmediatelyRunFileActions(string path)
- {
- var result = NativeMethods.immediately_run_file_actions(path, (IntPtr)path.Length, out var ex);
- ex.ThrowIfNecessary();
-
- return result;
- }
-
- public static void ReconnectSessions()
- {
- NativeMethods.reconnect();
- }
-
- public static SessionHandle GetSession(string path, SyncConfiguration configuration, byte[] encryptionKey)
- {
- DoInitialMetadataConfiguration();
-
- var result = NativeMethods.get_session(path, (IntPtr)path.Length, configuration, encryptionKey, out var nativeException);
- nativeException.ThrowIfNecessary();
-
- return new SessionHandle(result);
- }
-
- public static RealmPrivileges GetPrivileges(this SharedRealmHandle handle)
- {
- var result = NativeMethods.get_realm_privileges(handle, out var ex);
- ex.ThrowIfNecessary();
- return (RealmPrivileges)result;
- }
-
- public static ClassPrivileges GetPrivileges(this SharedRealmHandle handle, string className)
- {
- var result = NativeMethods.get_class_privileges(handle, className, (IntPtr)className.Length, out var ex);
- ex.ThrowIfNecessary();
- return (ClassPrivileges)result;
- }
-
- public static ObjectPrivileges GetPrivileges(this SharedRealmHandle handle, ObjectHandle objectHandle)
- {
- var result = NativeMethods.get_object_privileges(handle, objectHandle, out var ex);
- ex.ThrowIfNecessary();
- return (ObjectPrivileges)result;
- }
-
- [MonoPInvokeCallback(typeof(NativeMethods.RefreshAccessTokenCallbackDelegate))]
- private static void RefreshAccessTokenCallback(IntPtr sessionHandlePtr)
- {
- var handle = new SessionHandle(sessionHandlePtr);
- var session = new Session(handle);
- AuthenticationHelper.RefreshAccessTokenAsync(session).ContinueWith(_ => session.CloseHandle());
- }
-
- [MonoPInvokeCallback(typeof(NativeMethods.SessionErrorCallback))]
- private static unsafe void HandleSessionError(IntPtr sessionHandlePtr, ErrorCode errorCode, byte* messageBuffer, IntPtr messageLength, IntPtr userInfoPairs, int userInfoPairsLength)
- {
- var handle = new SessionHandle(sessionHandlePtr);
- var session = new Session(handle);
- var message = Encoding.UTF8.GetString(messageBuffer, (int)messageLength);
-
- SessionException exception;
-
- if (errorCode.IsClientResetError())
- {
- var userInfo = MarshalErrorUserInfo(userInfoPairs, userInfoPairsLength);
- exception = new ClientResetException(message, userInfo);
- }
- else if (errorCode == ErrorCode.PermissionDenied)
- {
- var userInfo = MarshalErrorUserInfo(userInfoPairs, userInfoPairsLength);
- exception = new PermissionDeniedException(message, userInfo);
- }
- else
- {
- exception = new SessionException(message, errorCode);
- }
-
- Session.RaiseError(session, exception);
- }
-
- private static Dictionary MarshalErrorUserInfo(IntPtr userInfoPairs, int userInfoPairsLength)
- {
- return Enumerable.Range(0, userInfoPairsLength)
- .Select(i => Marshal.PtrToStructure(IntPtr.Add(userInfoPairs, i * StringStringPair.Size)))
- .ToDictionary(pair => pair.Key, pair => pair.Value);
- }
-
- [MonoPInvokeCallback(typeof(NativeMethods.SessionProgressCallback))]
- private static void HandleSessionProgress(IntPtr tokenPtr, ulong transferredBytes, ulong transferableBytes)
- {
- var token = (ProgressNotificationToken)GCHandle.FromIntPtr(tokenPtr).Target;
- token.Notify(transferredBytes, transferableBytes);
- }
-
- [MonoPInvokeCallback(typeof(NativeMethods.SessionWaitCallback))]
- private static unsafe void HandleSessionWaitCallback(IntPtr taskCompletionSource, int error_code, byte* messageBuffer, IntPtr messageLength)
- {
- var handle = GCHandle.FromIntPtr(taskCompletionSource);
- var tcs = (TaskCompletionSource)handle.Target;
-
- try
- {
- if (error_code == 0)
- {
- tcs.TrySetResult(null);
- }
- else
- {
- var inner = new SessionException(Encoding.UTF8.GetString(messageBuffer, (int)messageLength), (ErrorCode)error_code);
- const string OuterMessage = "A system error occurred while waiting for completion. See InnerException for more details";
- tcs.TrySetException(new RealmException(OuterMessage, inner));
- }
- }
- finally
- {
- handle.Free();
- }
- }
-
- [MonoPInvokeCallback(typeof(NativeMethods.OpenRealmCallback))]
- [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The task awaiter will own the ThreadSafeReference handle.")]
- private static unsafe void HandleOpenRealmCallback(IntPtr taskCompletionSource, IntPtr realm_reference, int error_code, byte* messageBuffer, IntPtr messageLength)
- {
- var handle = GCHandle.FromIntPtr(taskCompletionSource);
- var tcs = (TaskCompletionSource)handle.Target;
-
- if (error_code == 0)
- {
- tcs.TrySetResult(new ThreadSafeReferenceHandle(realm_reference, isRealmReference: true));
- }
- else
- {
- var inner = new SessionException(Encoding.UTF8.GetString(messageBuffer, (int)messageLength), (ErrorCode)error_code);
- const string OuterMessage = "A system error occurred while opening a Realm. See InnerException for more details";
- tcs.TrySetException(new RealmException(OuterMessage, inner));
- }
- }
-
- [MonoPInvokeCallback(typeof(NativeMethods.LogMessageCallback))]
- private static unsafe void HandleLogMessage(byte* messageBuffer, IntPtr messageLength, LogLevel level)
- {
- try
- {
- var message = Encoding.UTF8.GetString(messageBuffer, (int)messageLength);
- SyncConfigurationBase.CustomLogger?.Invoke(message, level);
- }
- catch (Exception ex)
- {
- var errorMessage = $"An error occurred while trying to log a message: {ex}";
- try
- {
- SyncConfigurationBase.CustomLogger(errorMessage, LogLevel.Error);
- }
- catch
- {
- Console.Error.WriteLine(errorMessage);
- }
- }
- }
- }
-}
diff --git a/Realm/Realm/Handles/SortDescriptorHandle.cs b/Realm/Realm/Handles/SortDescriptorHandle.cs
index 86976e7f88..f0985e1fb2 100644
--- a/Realm/Realm/Handles/SortDescriptorHandle.cs
+++ b/Realm/Realm/Handles/SortDescriptorHandle.cs
@@ -18,15 +18,11 @@
using System;
using System.Runtime.InteropServices;
-using Realms.Native;
namespace Realms
{
internal class SortDescriptorHandle : RealmHandle
{
- // This is a delegate type meant to represent one of the "query operator" methods such as float_less and bool_equal
- internal delegate void Operation(QueryHandle queryPtr, ColumnKey columnKey, T value);
-
private static class NativeMethods
{
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "sort_descriptor_destroy", CallingConvention = CallingConvention.Cdecl)]
@@ -34,8 +30,8 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "sort_descriptor_add_clause", CallingConvention = CallingConvention.Cdecl)]
public static extern void add_clause(SortDescriptorHandle descriptor, TableHandle query, SharedRealmHandle realm,
- [MarshalAs(UnmanagedType.LPArray), In] IntPtr[] property_chain, IntPtr properties_count,
- [MarshalAs(UnmanagedType.I1)] bool ascending,
+ [MarshalAs(UnmanagedType.LPArray), In] IntPtr[] property_index_chain, IntPtr column_keys_count,
+ [MarshalAs(UnmanagedType.U1)] bool ascending,
out NativeException ex);
}
@@ -43,9 +39,9 @@ public SortDescriptorHandle(RealmHandle root, IntPtr handle) : base(root, handle
{
}
- public void AddClause(TableHandle table, SharedRealmHandle realm, IntPtr[] propertyChain, bool ascending)
+ public void AddClause(TableHandle table, SharedRealmHandle realm, IntPtr[] propertyIndexChain, bool ascending)
{
- NativeMethods.add_clause(this, table, realm, propertyChain, (IntPtr)propertyChain.Length, ascending, out var nativeException);
+ NativeMethods.add_clause(this, table, realm, propertyIndexChain, (IntPtr)propertyIndexChain.Length, ascending, out var nativeException);
nativeException.ThrowIfNecessary();
}
diff --git a/Realm/Realm/Handles/SubscriptionHandle.cs b/Realm/Realm/Handles/SubscriptionHandle.cs
deleted file mode 100644
index 0b8464eb87..0000000000
--- a/Realm/Realm/Handles/SubscriptionHandle.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2018 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Linq;
-using System.Runtime.InteropServices;
-using Realms.Exceptions;
-
-namespace Realms.Sync
-{
- internal class SubscriptionHandle : RealmHandle
- {
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate void SubscriptionCallbackDelegate(IntPtr managedHandle);
-
- private static class NativeMethods
- {
-#pragma warning disable IDE1006 // Naming Styles
-#pragma warning disable SA1121 // Use built-in type alias
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_subscription_destroy", CallingConvention = CallingConvention.Cdecl)]
- public static extern void destroy(IntPtr handle);
-
- // -1 for name_len and time_to_live means "no value" as both would be meaningless with negative numbers
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_subscription_create", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr subscribe(
- ResultsHandle results,
- [MarshalAs(UnmanagedType.LPWStr)] string name, int name_len,
- long time_to_live,
- [MarshalAs(UnmanagedType.I1)] bool update,
- [MarshalAs(UnmanagedType.LPArray), In] Native.StringValue[] inclusions, int inclusions_length,
- out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_subscription_get_state", CallingConvention = CallingConvention.Cdecl)]
- public static extern sbyte get_state(SubscriptionHandle subscription, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_subscription_get_error", CallingConvention = CallingConvention.Cdecl)]
- public static extern NativeException get_error(SubscriptionHandle subscription);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_subscription_add_notification_callback", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr add_notification_callback(SubscriptionHandle subscription, IntPtr managedSubscriptionHandle, SubscriptionCallbackDelegate callback, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_subscription_unsubscribe", CallingConvention = CallingConvention.Cdecl)]
- public static extern void unsubscribe(SubscriptionHandle subscription, out NativeException ex);
-
-#pragma warning restore IDE1006 // Naming Styles
-#pragma warning restore SA1121 // Use built-in type alias
- }
-
- [Preserve]
- private SubscriptionHandle(IntPtr handle) : base(null, handle)
- {
- }
-
- public static SubscriptionHandle Create(ResultsHandle results, string name, long? timeToLive, bool update, string[] inclusions)
- {
- var nativeInclusions = Array.Empty();
- if (inclusions != null)
- {
- nativeInclusions = inclusions.Select(i => new Native.StringValue { Value = i }).ToArray();
- }
-
- // We use -1 to signal "no value"
- var handle = NativeMethods.subscribe(
- results,
- name, name?.Length ?? -1,
- timeToLive ?? -1,
- update,
- nativeInclusions, inclusions?.Length ?? -1,
- out var ex);
-
- ex.ThrowIfNecessary();
-
- return new SubscriptionHandle(handle);
- }
-
- public SubscriptionState GetState()
- {
- var result = NativeMethods.get_state(this, out var ex);
- ex.ThrowIfNecessary();
- return (SubscriptionState)result;
- }
-
- public Exception GetError()
- {
- var result = NativeMethods.get_error(this);
- if (result.type != RealmExceptionCodes.NoError)
- {
- return result.Convert();
- }
-
- return null;
- }
-
- public SubscriptionTokenHandle AddNotificationCallback(IntPtr managedObjectHandle, SubscriptionCallbackDelegate callback)
- {
- var result = NativeMethods.add_notification_callback(this, managedObjectHandle, callback, out var ex);
- ex.ThrowIfNecessary();
- return new SubscriptionTokenHandle(this, result);
- }
-
- public void Unsubscribe()
- {
- NativeMethods.unsubscribe(this, out var ex);
- ex.ThrowIfNecessary();
- }
-
- protected override void Unbind()
- {
- NativeMethods.destroy(handle);
- }
- }
-}
diff --git a/Realm/Realm/Handles/SubscriptionTokenHandle.cs b/Realm/Realm/Handles/SubscriptionTokenHandle.cs
deleted file mode 100644
index cef0185986..0000000000
--- a/Realm/Realm/Handles/SubscriptionTokenHandle.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2018 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Realms.Sync
-{
- internal class SubscriptionTokenHandle : RealmHandle
- {
- private static class NativeMethods
- {
-#pragma warning disable IDE1006 // Naming Styles
-#pragma warning disable SA1121 // Use built-in type alias
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_subscription_destroy_notification_token", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr destroy_notificationtoken(IntPtr token, out NativeException ex);
-
-#pragma warning restore IDE1006 // Naming Styles
-#pragma warning restore SA1121 // Use built-in type alias
- }
-
- public SubscriptionTokenHandle(SubscriptionHandle root, IntPtr handle) : base(root, handle)
- {
- }
-
- protected override void Unbind()
- {
- var managedObjectHandle = NativeMethods.destroy_notificationtoken(handle, out var ex);
- ex.ThrowIfNecessary();
- GCHandle.FromIntPtr(managedObjectHandle).Free();
- }
- }
-}
\ No newline at end of file
diff --git a/Realm/Realm/Handles/SyncUserHandle.cs b/Realm/Realm/Handles/SyncUserHandle.cs
index 8ad2de734c..ae00f24bda 100644
--- a/Realm/Realm/Handles/SyncUserHandle.cs
+++ b/Realm/Realm/Handles/SyncUserHandle.cs
@@ -17,9 +17,12 @@
////////////////////////////////////////////////////////////////////////////
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using MongoDB.Bson;
+using Realms.Native;
+using Realms.Sync.Exceptions;
+using Realms.Sync.Native;
namespace Realms.Sync
{
@@ -27,60 +30,126 @@ internal class SyncUserHandle : RealmHandle
{
private static class NativeMethods
{
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_get_sync_user", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_sync_user([MarshalAs(UnmanagedType.LPWStr)] string identity, IntPtr identity_len,
- [MarshalAs(UnmanagedType.LPWStr)] string auth_server_url, IntPtr auth_server_url_len,
- [MarshalAs(UnmanagedType.LPWStr)] string refresh_token, IntPtr refresh_token_len,
- [MarshalAs(UnmanagedType.I1)] bool is_admin, out NativeException ex);
+#pragma warning disable IDE1006 // Naming Styles
+#pragma warning disable SA1121 // Use built-in type alias
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_get_admintoken_user", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_admintoken_user([MarshalAs(UnmanagedType.LPWStr)] string auth_server_url, IntPtr auth_server_url_len,
- [MarshalAs(UnmanagedType.LPWStr)] string token, IntPtr token_len,
- out NativeException ex);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void ApiKeysCallback(IntPtr tcs_ptr, /* UserApiKey[] */ IntPtr api_keys, int api_keys_len, AppError error);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_identity", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_identity(SyncUserHandle user, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_id", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_user_id(SyncUserHandle user, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_refresh_token", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_refresh_token(SyncUserHandle user, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_set_refresh_token", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr set_refresh_token(SyncUserHandle user, [MarshalAs(UnmanagedType.LPWStr)] string refresh_token, IntPtr refresh_token_len, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_access_token", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_access_token(SyncUserHandle user, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_server_url", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_server_url(SyncUserHandle user, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_device_id", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_device_id(SyncUserHandle user, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_state", CallingConvention = CallingConvention.Cdecl)]
public static extern UserState get_state(SyncUserHandle user, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_is_admin", CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool get_is_admin(SyncUserHandle user);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_auth_provider", CallingConvention = CallingConvention.Cdecl)]
+ public static extern Credentials.AuthProvider get_auth_provider(SyncUserHandle user, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_profile_data", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_profile_data(SyncUserHandle user, UserProfileField field,
+ IntPtr buffer, IntPtr buffer_length, [MarshalAs(UnmanagedType.U1)] out bool isNull,
+ out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_custom_data", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_custom_data(SyncUserHandle user, IntPtr buffer, IntPtr buffer_length,
+ [MarshalAs(UnmanagedType.U1)] out bool isNull, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_app", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_app(SyncUserHandle user, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_log_out", CallingConvention = CallingConvention.Cdecl)]
public static extern void log_out(SyncUserHandle user, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_get_current_sync_user", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_current_user(out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_get_logged_in_users", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_logged_in_users([Out] IntPtr[] users, IntPtr bufsize, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_refresh_custom_data", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void refresh_custom_data(SyncUserHandle user, IntPtr tcs_ptr, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_destroy", CallingConvention = CallingConvention.Cdecl)]
public static extern void destroy(IntPtr syncuserHandle);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_get_logged_in_user", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_logged_in_user([MarshalAs(UnmanagedType.LPWStr)] string identity, IntPtr identity_len,
- [MarshalAs(UnmanagedType.LPWStr)] string auth_server_url, IntPtr auth_server_url_len,
- out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_sync_user_initialize", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr initialize(ApiKeysCallback api_keys_callback);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_call_function", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void call_function(SyncUserHandle handle, AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string function_name, IntPtr function_name_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string args, IntPtr args_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_link_credentials", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void link_credentials(SyncUserHandle handle, AppHandle app, Native.Credentials credentials, IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_serialized_identities", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_identities(SyncUserHandle handle, IntPtr buffer, IntPtr bufsize, out NativeException ex);
+
+ #region Push
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_push_register", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void push_register(SyncUserHandle handle, AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string service, IntPtr service_len,
+ [MarshalAs(UnmanagedType.LPWStr)] string token, IntPtr token_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_push_deregister", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void push_deregister(SyncUserHandle handle, AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string service, IntPtr service_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ #endregion
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_get_session", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_session(SyncUserHandle user, [MarshalAs(UnmanagedType.LPWStr)] string path, IntPtr path_len, out NativeException ex);
+ #region Api Keys
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_api_key_create", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void create_api_key(SyncUserHandle handle, AppHandle app,
+ [MarshalAs(UnmanagedType.LPWStr)] string name, IntPtr name_len,
+ IntPtr tcs_ptr, out NativeException ex);
+
+ // id is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_api_key_fetch", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void fetch_api_key(SyncUserHandle handle, AppHandle app, IntPtr id, IntPtr tcs_ptr, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_api_key_fetch_all", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void fetch_api_keys(SyncUserHandle handle, AppHandle app, IntPtr tcs_ptr, out NativeException ex);
+
+ // id is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_api_key_delete", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void delete_api_key(SyncUserHandle handle, AppHandle app, IntPtr id, IntPtr tcs_ptr, out NativeException ex);
+
+ // id is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_api_key_disable", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void disable_api_key(SyncUserHandle handle, AppHandle app, IntPtr id, IntPtr tcs_ptr, out NativeException ex);
+
+ // id is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_syncuser_api_key_enable", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void enable_api_key(SyncUserHandle handle, AppHandle app, IntPtr id, IntPtr tcs_ptr, out NativeException ex);
+
+ #endregion
+
+#pragma warning restore IDE1006 // Naming Styles
+#pragma warning restore SA1121 // Use built-in type alias
}
- static SyncUserHandle()
+ static unsafe SyncUserHandle()
{
NativeCommon.Initialize();
+
+ NativeMethods.ApiKeysCallback apiKeysCallback = HandleApiKeysCallback;
+
+ GCHandle.Alloc(apiKeysCallback);
+
+ NativeMethods.initialize(apiKeysCallback);
}
[Preserve]
@@ -88,12 +157,12 @@ public SyncUserHandle(IntPtr handle) : base(null, handle)
{
}
- public string GetIdentity()
+ public string GetUserId()
{
return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
{
isNull = false;
- return NativeMethods.get_identity(this, buffer, length, out ex);
+ return NativeMethods.get_user_id(this, buffer, length, out ex);
});
}
@@ -106,18 +175,21 @@ public string GetRefreshToken()
});
}
- public void SetRefreshToken(string token)
+ public string GetAccessToken()
{
- NativeMethods.set_refresh_token(this, token, (IntPtr)token.Length, out var ex);
- ex.ThrowIfNecessary();
+ return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
+ {
+ isNull = false;
+ return NativeMethods.get_access_token(this, buffer, length, out ex);
+ });
}
- public string GetServerUrl()
+ public string GetDeviceId()
{
return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
{
isNull = false;
- return NativeMethods.get_server_url(this, buffer, length, out ex);
+ return NativeMethods.get_device_id(this, buffer, length, out ex);
});
}
@@ -128,23 +200,25 @@ public UserState GetState()
return result;
}
- public bool GetIsAdmin()
+ public Credentials.AuthProvider GetProvider()
{
- return NativeMethods.get_is_admin(this);
+ var result = NativeMethods.get_auth_provider(this, out var ex);
+ ex.ThrowIfNecessary();
+ return result;
}
- public bool TryGetSession(string path, out SessionHandle handle)
+ public bool TryGetApp(out AppHandle appHandle)
{
- var result = NativeMethods.get_session(this, path, (IntPtr)path.Length, out var ex);
+ var result = NativeMethods.get_app(this, out var ex);
ex.ThrowIfNecessary();
if (result == IntPtr.Zero)
{
- handle = null;
+ appHandle = null;
return false;
}
- handle = new SessionHandle(result);
+ appHandle = new AppHandle(result);
return true;
}
@@ -154,68 +228,158 @@ public void LogOut()
ex.ThrowIfNecessary();
}
- public static SyncUserHandle GetSyncUser(string identity, string authServerUrl, string refreshToken, bool isAdmin)
+ public void RefreshCustomData(TaskCompletionSource tcs)
{
- var userPtr = NativeMethods.get_sync_user(identity, (IntPtr)identity.Length,
- authServerUrl, (IntPtr)authServerUrl.Length,
- refreshToken, (IntPtr)refreshToken.Length,
- isAdmin, out var ex);
- ex.ThrowIfNecessary();
+ var tcsHandle = GCHandle.Alloc(tcs);
+ NativeMethods.refresh_custom_data(this, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
+ }
- return new SyncUserHandle(userPtr);
+ public string GetProfileData(UserProfileField field)
+ {
+ return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
+ {
+ return NativeMethods.get_profile_data(this, field, buffer, length, out isNull, out ex);
+ });
+ }
+
+ public string GetCustomData()
+ {
+ return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
+ {
+ return NativeMethods.get_custom_data(this, buffer, length, out isNull, out ex);
+ });
}
- public static SyncUserHandle GetAdminTokenUser(string authServerUrl, string token)
+ public void CallFunction(AppHandle app, string name, string args, TaskCompletionSource tcs)
{
- var userPtr = NativeMethods.get_admintoken_user(authServerUrl, (IntPtr)authServerUrl.Length,
- token, (IntPtr)token.Length,
- out var ex);
+ var tcsHandle = GCHandle.Alloc(tcs);
+
+ NativeMethods.call_function(this, app, name, (IntPtr)name.Length, args, (IntPtr)args.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
ex.ThrowIfNecessary();
+ }
- return new SyncUserHandle(userPtr);
+ public void LinkCredentials(AppHandle app, Native.Credentials credentials, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ NativeMethods.link_credentials(this, app, credentials, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
}
- public static bool TryGetCurrentUser(out SyncUserHandle handle)
+ public string GetIdentities()
{
- var userPtr = NativeMethods.get_current_user(out var ex);
+ return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
+ {
+ isNull = false;
+ return NativeMethods.get_identities(this, buffer, length, out ex);
+ });
+ }
+
+ #region Push
+
+ public void RegisterPushToken(AppHandle app, string service, string token, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+
+ NativeMethods.push_register(this, app, service, (IntPtr)service.Length, token, (IntPtr)token.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
ex.ThrowIfNecessary();
+ }
- if (userPtr == IntPtr.Zero)
- {
- handle = null;
- return false;
- }
+ public void DeregisterPushToken(AppHandle app, string service, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
- handle = new SyncUserHandle(userPtr);
- return true;
+ NativeMethods.push_deregister(this, app, service, (IntPtr)service.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary();
}
- public static IEnumerable GetAllLoggedInUsers()
+ #endregion
+
+ #region Api Keys
+
+ public void CreateApiKey(AppHandle app, string name, TaskCompletionSource tcs)
{
- return MarshalHelpers.GetCollection(NativeMethods.get_logged_in_users, bufferSize: 8)
- .Select(h => new SyncUserHandle(h));
+ var tcsHandle = GCHandle.Alloc(tcs);
+ NativeMethods.create_api_key(this, app, name, (IntPtr)name.Length, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
}
- public static bool TryGetLoggedInUser(string identity, string authServerUrl, out SyncUserHandle handle)
+ public unsafe void FetchApiKey(AppHandle app, ObjectId id, TaskCompletionSource tcs)
{
- var userPtr = NativeMethods.get_logged_in_user(identity, (IntPtr)identity.Length,
- authServerUrl, (IntPtr)authServerUrl.Length,
- out var ex);
- ex.ThrowIfNecessary();
+ var tcsHandle = GCHandle.Alloc(tcs);
+ var primitiveId = PrimitiveValue.ObjectId(id);
+ PrimitiveValue* idPtr = &primitiveId;
+ NativeMethods.fetch_api_key(this, app, new IntPtr(idPtr), GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
+ }
- if (userPtr == IntPtr.Zero)
- {
- handle = null;
- return false;
- }
+ public void FetchAllApiKeys(AppHandle app, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ NativeMethods.fetch_api_keys(this, app, GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
+ }
- handle = new SyncUserHandle(userPtr);
- return true;
+ public unsafe void DeleteApiKey(AppHandle app, ObjectId id, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ var primitiveId = PrimitiveValue.ObjectId(id);
+ PrimitiveValue* idPtr = &primitiveId;
+ NativeMethods.delete_api_key(this, app, new IntPtr(idPtr), GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
}
+ public unsafe void DisableApiKey(AppHandle app, ObjectId id, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ var primitiveId = PrimitiveValue.ObjectId(id);
+ PrimitiveValue* idPtr = &primitiveId;
+ NativeMethods.disable_api_key(this, app, new IntPtr(idPtr), GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
+ }
+
+ public unsafe void EnableApiKey(AppHandle app, ObjectId id, TaskCompletionSource tcs)
+ {
+ var tcsHandle = GCHandle.Alloc(tcs);
+ var primitiveId = PrimitiveValue.ObjectId(id);
+ PrimitiveValue* idPtr = &primitiveId;
+ NativeMethods.enable_api_key(this, app, new IntPtr(idPtr), GCHandle.ToIntPtr(tcsHandle), out var ex);
+ ex.ThrowIfNecessary(tcsHandle);
+ }
+
+ #endregion
+
protected override void Unbind()
{
NativeMethods.destroy(handle);
}
+
+ [MonoPInvokeCallback(typeof(NativeMethods.ApiKeysCallback))]
+ private static unsafe void HandleApiKeysCallback(IntPtr tcs_ptr, IntPtr api_keys, int api_keys_len, AppError error)
+ {
+ var tcsHandle = GCHandle.FromIntPtr(tcs_ptr);
+ try
+ {
+ var tcs = (TaskCompletionSource)tcsHandle.Target;
+ if (error.is_null)
+ {
+ var result = new UserApiKey[api_keys_len];
+ for (var i = 0; i < api_keys_len; i++)
+ {
+ result[i] = Marshal.PtrToStructure(IntPtr.Add(api_keys, i * UserApiKey.Size));
+ }
+
+ tcs.TrySetResult(result);
+ }
+ else
+ {
+ tcs.TrySetException(new AppException(error));
+ }
+ }
+ finally
+ {
+ tcsHandle.Free();
+ }
+ }
}
}
diff --git a/Realm/Realm/Handles/TableHandle.cs b/Realm/Realm/Handles/TableHandle.cs
index 996405c4f5..ca9f1b43d3 100644
--- a/Realm/Realm/Handles/TableHandle.cs
+++ b/Realm/Realm/Handles/TableHandle.cs
@@ -35,12 +35,6 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "table_create_results", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_results(TableHandle handle, SharedRealmHandle sharedRealm, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "table_get_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_name(TableHandle handle, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "table_get_column_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_column_name(TableHandle table, ColumnKey column_key, IntPtr buffer, IntPtr buffer_length, out NativeException ex);
-
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "table_get_object", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr get_object(TableHandle table, SharedRealmHandle realm, ObjectKey objectKey, out NativeException ex);
@@ -48,11 +42,10 @@ private static class NativeMethods
public static extern IntPtr get_object_for_string_primarykey(TableHandle handle, SharedRealmHandle realmHandle,
[MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "table_get_object_for_int_primarykey", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_object_for_int_primarykey(TableHandle handle, SharedRealmHandle realmHandle, Int64 value, out NativeException ex);
-
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "table_get_object_for_null_primarykey", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr get_object_for_null_primarykey(TableHandle handle, SharedRealmHandle realmHandle, out NativeException ex);
+ // value is IntPtr rather than PrimitiveValue due to a bug in .NET Core on Linux and Mac
+ // that causes incorrect marshalling of the struct.
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "table_get_object_for_primitive_primarykey", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr get_object_for_primitive_primarykey(TableHandle handle, SharedRealmHandle realmHandle, IntPtr value, out NativeException ex);
#pragma warning restore IDE1006 // Naming Styles
#pragma warning restore SA1121 // Use built-in type alias
@@ -89,69 +82,29 @@ public ObjectHandle Get(SharedRealmHandle realmHandle, ObjectKey objectKey)
return new ObjectHandle(realmHandle, result);
}
- public string GetName()
+ public bool TryFind(SharedRealmHandle realmHandle, string id, out ObjectHandle objectHandle)
{
- return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
- {
- isNull = false;
- return NativeMethods.get_name(this, buffer, length, out ex);
- });
+ var result = NativeMethods.get_object_for_string_primarykey(this, realmHandle, id, (IntPtr)(id?.Length ?? 0), out var ex);
+ return TryFindCore(realmHandle, result, ex, out objectHandle);
}
- public string GetColumnName(ColumnKey columnKey)
+ public unsafe bool TryFind(SharedRealmHandle realmHandle, PrimitiveValue id, out ObjectHandle objectHandle)
{
- return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) =>
- {
- isNull = false;
- return NativeMethods.get_column_name(this, columnKey, buffer, length, out ex);
- });
+ PrimitiveValue* valuePtr = &id;
+ var result = NativeMethods.get_object_for_primitive_primarykey(this, realmHandle, new IntPtr(valuePtr), out var ex);
+ return TryFindCore(realmHandle, result, ex, out objectHandle);
}
- public bool TryFind(SharedRealmHandle realmHandle, string id, out ObjectHandle objectHandle)
+ private static bool TryFindCore(SharedRealmHandle realmHandle, IntPtr objectPtr, NativeException nativeException, out ObjectHandle objectHandle)
{
- NativeException nativeException;
- IntPtr result;
- if (id == null)
- {
- result = NativeMethods.get_object_for_null_primarykey(this, realmHandle, out nativeException);
- }
- else
- {
- result = NativeMethods.get_object_for_string_primarykey(this, realmHandle, id, (IntPtr)id.Length, out nativeException);
- }
-
nativeException.ThrowIfNecessary();
- if (result == IntPtr.Zero)
- {
- objectHandle = null;
- return false;
- }
-
- objectHandle = new ObjectHandle(realmHandle, result);
- return true;
- }
-
- public bool TryFind(SharedRealmHandle realmHandle, long? id, out ObjectHandle objectHandle)
- {
- NativeException nativeException;
- IntPtr result;
- if (id.HasValue)
- {
- result = NativeMethods.get_object_for_int_primarykey(this, realmHandle, id.Value, out nativeException);
- }
- else
- {
- result = NativeMethods.get_object_for_null_primarykey(this, realmHandle, out nativeException);
- }
-
- nativeException.ThrowIfNecessary();
- if (result == IntPtr.Zero)
+ if (objectPtr == IntPtr.Zero)
{
objectHandle = null;
return false;
}
- objectHandle = new ObjectHandle(realmHandle, result);
+ objectHandle = new ObjectHandle(realmHandle, objectPtr);
return true;
}
}
diff --git a/Realm/Realm/Helpers/AuthenticationHelper.cs b/Realm/Realm/Helpers/AuthenticationHelper.cs
deleted file mode 100644
index 76ce19b8a3..0000000000
--- a/Realm/Realm/Helpers/AuthenticationHelper.cs
+++ /dev/null
@@ -1,341 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Net;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using Realms.Sync.Exceptions;
-
-namespace Realms.Sync
-{
- internal static class AuthenticationHelper
- {
- private static readonly string AppId = string.Empty; // FIXME
- private static readonly Lazy _client = new Lazy(() => new HttpClient { Timeout = TimeSpan.FromSeconds(30) });
-
- private static readonly ConcurrentDictionary _tokenRefreshTimers = new ConcurrentDictionary();
- private static readonly DateTimeOffset _date_1970 = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
- private static readonly MediaTypeHeaderValue _applicationJsonUtf8MediaType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- private static readonly MediaTypeHeaderValue _applicationProblemJsonUtf8MediaType = MediaTypeHeaderValue.Parse("application/problem+json; charset=utf-8");
-
- private static readonly HashSet _connectivityStatusCodes = new HashSet
- {
- HttpStatusCode.NotFound,
- HttpStatusCode.BadGateway,
- HttpStatusCode.ServiceUnavailable,
- HttpStatusCode.GatewayTimeout,
- HttpStatusCode.RequestTimeout,
- };
-
- public static async Task RefreshAccessTokenAsync(Session session, bool reportErrors = true)
- {
- var user = session.User;
- if (user == null)
- {
- return;
- }
-
- try
- {
- var json = new Dictionary
- {
- ["data"] = user.RefreshToken,
- ["path"] = session.ServerUri.AbsolutePath,
- ["provider"] = "realm",
- ["app_id"] = AppId
- };
-
- var result = await MakeAuthRequestAsync(HttpMethod.Post, new Uri(user.ServerUri, "auth"), json)
- .ConfigureAwait(continueOnCapturedContext: false);
-
- var syncWorker = result["sync_worker"];
- if (syncWorker != null)
- {
- session.Handle.SetUrlPrefix(syncWorker["path"].Value());
- }
-
- var accessToken = result["access_token"];
- var token_data = accessToken["token_data"];
-
- session.Handle.SetMultiplexIdentifier(token_data["sync_label"].Value());
-
- session.Handle.RefreshAccessToken(accessToken["token"].Value(), token_data["path"].Value());
- ScheduleTokenRefresh(user.Identity, user.ServerUri, session.Path, _date_1970.AddSeconds(accessToken["token_data"]["expires"].Value()));
- }
- catch (HttpException ex) when (_connectivityStatusCodes.Contains(ex.StatusCode))
- {
- // 30 seconds is an arbitrarily chosen value, consider rationalizing it.
- ScheduleTokenRefresh(user.Identity, user.ServerUri, session.Path, DateTimeOffset.UtcNow.AddSeconds(30));
- }
- catch (Exception ex)
- {
- if (reportErrors)
- {
- var sessionException = new SessionException("An error has occurred while refreshing the access token.",
- ErrorCode.BadUserAuthentication,
- ex);
-
- Session.RaiseError(session, sessionException);
- }
- }
- finally
- {
- // session.User creates a new user each time, so it's safe to dispose the handle here.
- // It won't actually corrupt the state of the session.
- user.Handle.Dispose();
- }
- }
-
- // Returns a Tuple
- public static async Task LoginAsync(Credentials credentials, Uri serverUrl)
- {
- var body = credentials.ToDictionary();
- body["app_id"] = AppId;
- var result = await MakeAuthRequestAsync(HttpMethod.Post, new Uri(serverUrl, "auth"), body)
- .ConfigureAwait(continueOnCapturedContext: false);
- var refreshToken = result["refresh_token"];
- return new UserLoginData
- {
- RefreshToken = refreshToken["token"].Value(),
- UserId = refreshToken["token_data"]["identity"].Value(),
- IsAdmin = refreshToken["token_data"]["is_admin"].Value()
- };
- }
-
- public static Task ChangePasswordAsync(User user, string password, string otherUserId = null)
- {
- var json = new Dictionary
- {
- ["data"] = new Dictionary
- {
- ["new_password"] = password
- }
- };
-
- if (otherUserId != null)
- {
- json["user_id"] = otherUserId;
- }
-
- return MakeAuthRequestAsync(HttpMethod.Put, new Uri(user.ServerUri, "auth/password"), json, user.RefreshToken);
- }
-
- public static async Task RetrieveInfoForUserAsync(User user, string provider, string providerId)
- {
- var uri = new Uri(user.ServerUri, $"/auth/users/{provider}/{providerId}");
- try
- {
- var response = await MakeAuthRequestAsync(HttpMethod.Get, uri, authHeader: user.RefreshToken)
- .ConfigureAwait(continueOnCapturedContext: false);
-
- var accounts = response["accounts"].Children()
- .Select(j => new AccountInfo
- {
- Provider = j["provider"].Value(),
- ProviderUserIdentity = j["provider_id"].Value()
- })
- .ToArray();
-
- var metadata = response["metadata"].Children()
- .ToDictionary(j => j["key"].Value(), j => j["value"].Value());
-
- return new UserInfo
- {
- Identity = response["user_id"].Value(),
- IsAdmin = response["is_admin"].Value(),
- Accounts = accounts,
- Metadata = metadata
- };
- }
- catch (HttpException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
- {
- return null;
- }
- }
-
- public static async Task LogOutAsync(Uri serverUri, string refreshToken)
- {
- var uri = new Uri(serverUri, "/auth/revoke");
- var body = new Dictionary
- {
- ["token"] = refreshToken
- };
-
- await MakeAuthRequestAsync(HttpMethod.Post, uri, body, refreshToken).ConfigureAwait(continueOnCapturedContext: false);
- }
-
- public static Task UpdateAccountAsync(Uri serverUri, string action, string email = null, IDictionary data = null)
- {
- data = data ?? new Dictionary();
- data["action"] = action;
-
- var body = new Dictionary
- {
- ["data"] = data
- };
-
- if (!string.IsNullOrEmpty(email))
- {
- body["provider_id"] = email;
- }
-
- var updateUri = new Uri(serverUri, "auth/password/updateAccount");
-
- return MakeAuthRequestAsync(HttpMethod.Post, updateUri, body);
- }
-
- private static void ScheduleTokenRefresh(string userId, Uri authServerUrl, string path, DateTimeOffset expireDate)
- {
- var dueTime = expireDate.AddSeconds(-10) - DateTimeOffset.UtcNow;
- var timerState = new TokenRefreshData
- {
- RealmPath = path,
- UserId = userId,
- ServerUrl = authServerUrl
- };
-
- if (dueTime < TimeSpan.Zero)
- {
- OnTimerCallback(timerState);
- }
-
- _tokenRefreshTimers.AddOrUpdate(
- path,
- p => new Timer(OnTimerCallback, timerState, dueTime, TimeSpan.FromMilliseconds(-1)),
- (p, old) =>
- {
- old.Dispose();
- return new Timer(OnTimerCallback, timerState, dueTime, TimeSpan.FromMilliseconds(-1));
- });
- }
-
- [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The Session handle is disposed after the session is refreshed.")]
- private static void OnTimerCallback(object state)
- {
- var data = (TokenRefreshData)state;
-
- try
- {
- var user = User.GetLoggedInUser(data.UserId, data.ServerUrl);
- if (user != null &&
- user.Handle.TryGetSession(data.RealmPath, out var sessionHandle))
- {
- var session = new Session(sessionHandle);
- RefreshAccessTokenAsync(session, reportErrors: false).ContinueWith(_ =>
- {
- user.Handle.Close();
- session.CloseHandle();
- });
- }
- }
- catch
- {
- }
- finally
- {
- if (_tokenRefreshTimers.TryRemove(data.RealmPath, out var timer))
- {
- timer.Dispose();
- }
- }
- }
-
- // Due to https://bugzilla.xamarin.com/show_bug.cgi?id=20082 we can't use dynamic deserialization.
- public static async Task MakeAuthRequestAsync(HttpMethod method, Uri uri, IDictionary body = null, string authHeader = null)
- {
- HttpResponseMessage response;
- using (var request = new HttpRequestMessage(method, uri))
- {
- if (body != null)
- {
- request.Content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json");
- }
-
- request.Headers.Accept.ParseAdd(_applicationJsonUtf8MediaType.MediaType);
- request.Headers.Accept.ParseAdd(_applicationProblemJsonUtf8MediaType.MediaType);
-
- if (!string.IsNullOrEmpty(authHeader))
- {
- request.Headers.TryAddWithoutValidation("Authorization", authHeader);
- }
-
- response = await _client.Value.SendAsync(request).ConfigureAwait(continueOnCapturedContext: false);
- }
-
- if (response.IsSuccessStatusCode && response.Content.Headers.ContentType.Equals(_applicationJsonUtf8MediaType))
- {
- var json = await response.Content.ReadAsStringAsync().ConfigureAwait(continueOnCapturedContext: false);
- return JObject.Parse(json);
- }
-
- var errorJson = await response.Content.ReadAsStringAsync().ConfigureAwait(continueOnCapturedContext: false);
-
- Exception ex;
- string helpLink = null;
- string errorMessage;
- ErrorCode errorCode;
- try
- {
- var problem = JObject.Parse(errorJson);
- errorCode = ErrorCodeHelper.GetErrorCode(problem["code"].Value()) ?? ErrorCode.Unknown;
- errorMessage = problem["title"].Value();
- helpLink = problem["type"].Value();
- }
- catch
- {
- errorCode = ErrorCode.Unknown;
- errorMessage = "An HTTP exception has occurred.";
- }
-
- ex = new HttpException(response.StatusCode, response.ReasonPhrase, errorJson, errorMessage, errorCode)
- {
- HelpLink = helpLink
- };
-
- throw ex;
- }
-
- private class TokenRefreshData
- {
- public string UserId { get; set; }
-
- public string RealmPath { get; set; }
-
- public Uri ServerUrl { get; set; }
- }
-
- public class UserLoginData
- {
- public string UserId { get; set; }
-
- public string RefreshToken { get; set; }
-
- public bool IsAdmin { get; set; }
- }
- }
-}
\ No newline at end of file
diff --git a/Realm/Realm/NotificationsHelper.cs b/Realm/Realm/Helpers/NotificationsHelper.cs
similarity index 98%
rename from Realm/Realm/NotificationsHelper.cs
rename to Realm/Realm/Helpers/NotificationsHelper.cs
index f0f5432cb4..99ff149938 100644
--- a/Realm/Realm/NotificationsHelper.cs
+++ b/Realm/Realm/Helpers/NotificationsHelper.cs
@@ -25,7 +25,7 @@ namespace Realms
internal static class NotificationsHelper
{
///
- /// INotifiable represents a reactive object (e.g. RealmObject/Collection).
+ /// INotifiable represents a reactive object (e.g. RealmObjectBase/Collection).
///
internal interface INotifiable
{
diff --git a/Realm/Realm/Helpers/Operator.cs b/Realm/Realm/Helpers/Operator.cs
index 3beb936e88..ef2d84dc55 100644
--- a/Realm/Realm/Helpers/Operator.cs
+++ b/Realm/Realm/Helpers/Operator.cs
@@ -19,12 +19,19 @@
using System;
using System.Linq;
using System.Linq.Expressions;
+using MongoDB.Bson;
namespace Realms.Helpers
{
// Heavily based on http://www.yoda.arachsys.com/csharp/miscutil/index.html
internal static class Operator
{
+ [Preserve]
+ static Operator()
+ {
+ _ = (decimal)new Decimal128(123);
+ }
+
public static T Add(T first, T second)
{
return GenericOperator.Add(first, second);
diff --git a/Realm/Realm/Helpers/SerializationHelper.cs b/Realm/Realm/Helpers/SerializationHelper.cs
new file mode 100644
index 0000000000..6ea98d4ee7
--- /dev/null
+++ b/Realm/Realm/Helpers/SerializationHelper.cs
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System.Linq;
+using MongoDB.Bson;
+using MongoDB.Bson.IO;
+using MongoDB.Bson.Serialization;
+using MongoDB.Bson.Serialization.Options;
+using MongoDB.Bson.Serialization.Serializers;
+
+namespace Realms.Helpers
+{
+ internal static class SerializationHelper
+ {
+ private static readonly JsonWriterSettings _jsonSettings = new JsonWriterSettings
+ {
+ OutputMode = JsonOutputMode.CanonicalExtendedJson,
+ };
+
+ static SerializationHelper()
+ {
+ var decimalSerializer = new DecimalSerializer(BsonType.Decimal128, new RepresentationConverter(allowOverflow: false, allowTruncation: false));
+ BsonSerializer.RegisterSerializer(decimalSerializer);
+ }
+
+ public static string ToNativeJson(this T value, bool tryDynamic = true)
+ {
+ if (tryDynamic && !(value is null))
+ {
+ if (typeof(T) == typeof(object))
+ {
+ return ToNativeJson((dynamic)value, tryDynamic: false);
+ }
+
+ if (typeof(T) == typeof(object[]))
+ {
+ var elements = (value as object[]).Select(o => o is null ? ToNativeJson(o, tryDynamic: false) : ToNativeJson((dynamic)o, tryDynamic: false));
+ return $"[{string.Join(",", elements)}]";
+ }
+ }
+
+ if (tryDynamic && (typeof(T) == typeof(object)) && !(value is null))
+ {
+ return ToNativeJson((dynamic)value, tryDynamic: false);
+ }
+
+ return value.ToJson(_jsonSettings);
+ }
+ }
+}
diff --git a/Realm/Realm/ISchemaSource.cs b/Realm/Realm/ISchemaSource.cs
deleted file mode 100644
index b55ae965ff..0000000000
--- a/Realm/Realm/ISchemaSource.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2016 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using Realms.Schema;
-
-namespace Realms
-{
- ///
- /// An object describing its properties in terms of a .
- ///
- public interface ISchemaSource
- {
- ///
- /// Gets the , describing the persisted properties of the object. If the object is a
- /// single , the schema will describe the object itself. If it is a collection, it will
- /// describe the contained objects.
- ///
- /// The ObjectSchema of the object or contained objects.
- ObjectSchema ObjectSchema { get; }
- }
-}
diff --git a/Realm/Realm/InteropConfig.cs b/Realm/Realm/InteropConfig.cs
index edb301adb5..04635796c3 100644
--- a/Realm/Realm/InteropConfig.cs
+++ b/Realm/Realm/InteropConfig.cs
@@ -53,16 +53,7 @@ internal static class InteropConfig
try
{
- var specialFolderType = typeof(Environment).GetNestedType("SpecialFolder", BindingFlags.Public);
- if (specialFolderType != null)
- {
- var getFolderPath = typeof(Environment).GetMethod("GetFolderPath", new[] { specialFolderType });
- if (getFolderPath != null)
- {
- var personalField = specialFolderType.GetField("Personal");
- return (string)getFolderPath.Invoke(null, new[] { personalField.GetValue(null) });
- }
- }
+ return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}
catch
{
@@ -78,7 +69,7 @@ internal static class InteropConfig
Directory.CreateDirectory(folder);
return folder;
- bool IsDirectoryWritable(string path)
+ static bool IsDirectoryWritable(string path)
{
if (!Directory.Exists(path))
{
diff --git a/Realm/Realm/Linq/IRealmCollection.cs b/Realm/Realm/Linq/IRealmCollection.cs
index e4ba12dd44..475d122698 100644
--- a/Realm/Realm/Linq/IRealmCollection.cs
+++ b/Realm/Realm/Linq/IRealmCollection.cs
@@ -20,6 +20,7 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
+using Realms.Schema;
namespace Realms
{
@@ -31,13 +32,13 @@ namespace Realms
/// or null if an has error occurred.
/// An exception that might have occurred while asynchronously monitoring a
/// for changes, or null if no errors have occurred.
- /// Type of the which is being returned.
+ /// Type of the , , or primitive which is being returned.
public delegate void NotificationCallbackDelegate(IRealmCollection sender, ChangeSet changes, Exception error);
///
- /// Iterable, sortable collection of one kind of RealmObject resulting from or from a LINQ query expression.
+ /// Iterable, sortable collection of one kind of RealmObjectBase resulting from or from a LINQ query expression.
///
- /// Type of the which is being returned.
+ /// Type of the , , or primitive which is being returned.
public interface IRealmCollection : IReadOnlyList, INotifyCollectionChanged, INotifyPropertyChanged
{
///
@@ -75,6 +76,14 @@ public interface IRealmCollection : IReadOnlyList, INotifyCollectionCh
/// The instance this collection belongs to.
Realm Realm { get; }
+ ///
+ /// Gets the , describing the persisted properties of the
+ /// s or s contained in the collection. If the collection contains
+ /// primitive values, ObjectSchema will be null .
+ ///
+ /// The ObjectSchema of the object or contained objects.
+ ObjectSchema ObjectSchema { get; }
+
///
/// Gets a value indicating whether this collection is frozen. Frozen collections are immutable and can be accessed
/// from any thread. The objects read from a frozen collection will also be frozen.
diff --git a/Realm/Realm/Linq/RealmResults.cs b/Realm/Realm/Linq/RealmResults.cs
index 52faa28561..e87cba08c0 100644
--- a/Realm/Realm/Linq/RealmResults.cs
+++ b/Realm/Realm/Linq/RealmResults.cs
@@ -36,13 +36,13 @@ internal class RealmResults : RealmCollectionBase, IOrderedQueryable, I
public IQueryProvider Provider { get; }
- internal RealmResults(Realm realm, RealmObject.Metadata metadata, RealmResultsProvider realmResultsProvider, Expression expression) : base(realm, metadata)
+ internal RealmResults(Realm realm, RealmObjectBase.Metadata metadata, RealmResultsProvider realmResultsProvider, Expression expression) : base(realm, metadata)
{
Provider = realmResultsProvider;
Expression = expression ?? Expression.Constant(this);
}
- internal RealmResults(Realm realm, RealmObject.Metadata metadata, ResultsHandle handle = null)
+ internal RealmResults(Realm realm, RealmObjectBase.Metadata metadata, ResultsHandle handle = null)
: this(realm, metadata, new RealmResultsProvider(realm, metadata), null)
{
_handle = handle ?? metadata.Table.CreateResults(realm.SharedRealmHandle);
@@ -88,7 +88,7 @@ public override int IndexOf(T value)
throw new NotSupportedException("IndexOf on non-object results is not supported.");
}
- var obj = Operator.Convert(value);
+ var obj = Operator.Convert(value);
if (!obj.IsManaged)
{
throw new ArgumentException("Value does not belong to a realm", nameof(value));
diff --git a/Realm/Realm/Linq/RealmResultsProvider.cs b/Realm/Realm/Linq/RealmResultsProvider.cs
index 4e97ebf3b8..059364cd76 100644
--- a/Realm/Realm/Linq/RealmResultsProvider.cs
+++ b/Realm/Realm/Linq/RealmResultsProvider.cs
@@ -27,9 +27,9 @@ namespace Realms
internal class RealmResultsProvider : IQueryProvider
{
private readonly Realm _realm;
- private readonly RealmObject.Metadata _metadata;
+ private readonly RealmObjectBase.Metadata _metadata;
- internal RealmResultsProvider(Realm realm, RealmObject.Metadata metadata)
+ internal RealmResultsProvider(Realm realm, RealmObjectBase.Metadata metadata)
{
_realm = realm;
_metadata = metadata;
diff --git a/Realm/Realm/Linq/RealmResultsVisitor.cs b/Realm/Realm/Linq/RealmResultsVisitor.cs
index fbb18787db..2258d0346e 100644
--- a/Realm/Realm/Linq/RealmResultsVisitor.cs
+++ b/Realm/Realm/Linq/RealmResultsVisitor.cs
@@ -23,6 +23,7 @@
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
+using MongoDB.Bson;
using Realms.Native;
using Realms.Schema;
using LazyMethod = System.Lazy;
@@ -32,7 +33,7 @@ namespace Realms
internal class RealmResultsVisitor : ExpressionVisitor
{
private readonly Realm _realm;
- private readonly RealmObject.Metadata _metadata;
+ private readonly RealmObjectBase.Metadata _metadata;
private QueryHandle _coreQueryHandle; // set when recurse down to VisitConstant
private SortDescriptorHandle _sortDescriptor;
@@ -77,7 +78,7 @@ internal static class String
}
}
- internal RealmResultsVisitor(Realm realm, RealmObject.Metadata metadata)
+ internal RealmResultsVisitor(Realm realm, RealmObjectBase.Metadata metadata)
{
_realm = realm;
_metadata = metadata;
@@ -150,7 +151,7 @@ private IntPtr[] TraverseSort(MemberExpression expression)
return chain.ToArray();
}
- [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The RealmObject instance will own its handle.")]
+ [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The RealmObjectBase instance will own its handle.")]
protected override Expression VisitMethodCall(MethodCallExpression node)
{
if (node.Method.DeclaringType == typeof(Queryable))
@@ -329,55 +330,55 @@ protected override Expression VisitMethodCall(MethodCallExpression node)
if (AreMethodsSame(node.Method, Methods.String.Contains.Value))
{
- queryMethod = (q, c, v) => q.StringContains(c, v, caseSensitive: true);
+ queryMethod = (q, r, p, v) => q.StringContains(r, p, v, caseSensitive: true);
}
else if (IsStringContainsWithComparison(node.Method, out var index))
{
member = node.Arguments[0] as MemberExpression;
stringArgumentIndex = index;
- queryMethod = (q, c, v) => q.StringContains(c, v, GetComparisonCaseSensitive(node));
+ queryMethod = (q, r, p, v) => q.StringContains(r, p, v, GetComparisonCaseSensitive(node));
}
else if (AreMethodsSame(node.Method, Methods.String.StartsWith.Value))
{
- queryMethod = (q, c, v) => q.StringStartsWith(c, v, caseSensitive: true);
+ queryMethod = (q, r, p, v) => q.StringStartsWith(r, p, v, caseSensitive: true);
}
else if (AreMethodsSame(node.Method, Methods.String.StartsWithStringComparison.Value))
{
- queryMethod = (q, c, v) => q.StringStartsWith(c, v, GetComparisonCaseSensitive(node));
+ queryMethod = (q, r, p, v) => q.StringStartsWith(r, p, v, GetComparisonCaseSensitive(node));
}
else if (AreMethodsSame(node.Method, Methods.String.EndsWith.Value))
{
- queryMethod = (q, c, v) => q.StringEndsWith(c, v, caseSensitive: true);
+ queryMethod = (q, r, p, v) => q.StringEndsWith(r, p, v, caseSensitive: true);
}
else if (AreMethodsSame(node.Method, Methods.String.EndsWithStringComparison.Value))
{
- queryMethod = (q, c, v) => q.StringEndsWith(c, v, GetComparisonCaseSensitive(node));
+ queryMethod = (q, r, p, v) => q.StringEndsWith(r, p, v, GetComparisonCaseSensitive(node));
}
else if (AreMethodsSame(node.Method, Methods.String.IsNullOrEmpty.Value))
{
member = node.Arguments.SingleOrDefault() as MemberExpression;
if (member == null)
{
- throw new NotSupportedException($"The method '{node.Method}' has to be invoked with a RealmObject member");
+ throw new NotSupportedException($"The method '{node.Method}' has to be invoked with a RealmObjectBase member");
}
var columnName = GetColumnName(member, node.NodeType);
- var columnKey = _coreQueryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
_coreQueryHandle.GroupBegin();
- _coreQueryHandle.NullEqual(columnKey);
+ _coreQueryHandle.NullEqual(_realm.SharedRealmHandle, propertyIndex);
_coreQueryHandle.Or();
- _coreQueryHandle.StringEqual(columnKey, string.Empty, caseSensitive: true);
+ _coreQueryHandle.StringEqual(_realm.SharedRealmHandle, propertyIndex, string.Empty, caseSensitive: true);
_coreQueryHandle.GroupEnd();
return node;
}
else if (AreMethodsSame(node.Method, Methods.String.EqualsMethod.Value))
{
- queryMethod = (q, c, v) => q.StringEqual(c, v, caseSensitive: true);
+ queryMethod = (q, r, p, v) => q.StringEqual(r, p, v, caseSensitive: true);
}
else if (AreMethodsSame(node.Method, Methods.String.EqualsStringComparison.Value))
{
- queryMethod = (q, c, v) => q.StringEqual(c, v, GetComparisonCaseSensitive(node));
+ queryMethod = (q, r, p, v) => q.StringEqual(r, p, v, GetComparisonCaseSensitive(node));
}
else if (AreMethodsSame(node.Method, Methods.String.Like.Value))
{
@@ -388,7 +389,7 @@ protected override Expression VisitMethodCall(MethodCallExpression node)
throw new NotSupportedException($"The method '{node.Method}' has to be invoked with a string and boolean constant arguments.");
}
- queryMethod = (q, c, v) => q.StringLike(c, v, (bool)caseSensitive);
+ queryMethod = (q, r, p, v) => q.StringLike(r, p, v, (bool)caseSensitive);
}
if (queryMethod != null)
@@ -397,11 +398,11 @@ protected override Expression VisitMethodCall(MethodCallExpression node)
if (member == null)
{
- throw new NotSupportedException($"The method '{node.Method}' has to be invoked on a RealmObject member");
+ throw new NotSupportedException($"The method '{node.Method}' has to be invoked on a RealmObjectBase member");
}
var columnName = GetColumnName(member, node.NodeType);
- var columnKey = _coreQueryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
if (!TryExtractConstantValue(node.Arguments[stringArgumentIndex], out object argument) ||
(argument != null && argument.GetType() != typeof(string)))
@@ -409,7 +410,7 @@ protected override Expression VisitMethodCall(MethodCallExpression node)
throw new NotSupportedException($"The method '{node.Method}' has to be invoked with a single string constant argument or closure variable");
}
- queryMethod(_coreQueryHandle, columnKey, (string)argument);
+ queryMethod(_coreQueryHandle, _realm.SharedRealmHandle, propertyIndex, (string)argument);
return node;
}
}
@@ -586,9 +587,9 @@ protected override Expression VisitBinary(BinaryExpression node)
throw new NotSupportedException($"The rhs of the binary operator '{rightExpression.NodeType}' should be a constant or closure variable expression. \nUnable to process '{node.Right}'.");
}
- if (rightValue is RealmObject obj && (!obj.IsManaged || !obj.IsValid))
+ if (rightValue is RealmObjectBase obj && (!obj.IsManaged || !obj.IsValid))
{
- throw new NotSupportedException($"The rhs of the binary operator '{rightExpression.NodeType}' should be a managed RealmObject. \nUnable to process '{node.Right}'.");
+ throw new NotSupportedException($"The rhs of the binary operator '{rightExpression.NodeType}' should be a managed RealmObjectBase. \nUnable to process '{node.Right}'.");
}
switch (node.NodeType)
@@ -619,29 +620,29 @@ protected override Expression VisitBinary(BinaryExpression node)
return node;
}
- private static void AddQueryEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
+ private void AddQueryEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
{
- var columnKey = queryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
switch (value)
{
case null:
- queryHandle.NullEqual(columnKey);
+ queryHandle.NullEqual(_realm.SharedRealmHandle, propertyIndex);
break;
case string stringValue:
- queryHandle.StringEqual(columnKey, stringValue, caseSensitive: true);
+ queryHandle.StringEqual(_realm.SharedRealmHandle, propertyIndex, stringValue, caseSensitive: true);
break;
case bool boolValue:
- queryHandle.BoolEqual(columnKey, boolValue);
+ queryHandle.PrimitiveEqual(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Bool(boolValue));
break;
case DateTimeOffset dateValue:
- queryHandle.TimestampTicksEqual(columnKey, dateValue);
+ queryHandle.PrimitiveEqual(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Date(dateValue));
break;
case byte[] buffer:
if (buffer.Length == 0)
{
- // see RealmObject.SetByteArrayValue
- queryHandle.BinaryEqual(columnKey, (IntPtr)0x1, IntPtr.Zero);
+ // see RealmObjectBase.SetByteArrayValue
+ queryHandle.BinaryEqual(_realm.SharedRealmHandle, propertyIndex, (IntPtr)0x1, IntPtr.Zero);
return;
}
@@ -649,43 +650,43 @@ private static void AddQueryEqual(QueryHandle queryHandle, string columnName, ob
{
fixed (byte* bufferPtr = (byte[])value)
{
- queryHandle.BinaryEqual(columnKey, (IntPtr)bufferPtr, (IntPtr)buffer.Length);
+ queryHandle.BinaryEqual(_realm.SharedRealmHandle, propertyIndex, (IntPtr)bufferPtr, (IntPtr)buffer.Length);
}
}
break;
- case RealmObject obj:
- queryHandle.ObjectEqual(columnKey, obj.ObjectHandle);
+ case RealmObjectBase obj:
+ queryHandle.ObjectEqual(_realm.SharedRealmHandle, propertyIndex, obj.ObjectHandle);
break;
default:
// The other types aren't handled by the switch because of potential compiler applied conversions
- AddQueryForConvertibleTypes(columnKey, value, columnType, queryHandle.NumericEqualMethods);
+ AddQueryForConvertibleTypes(_realm.SharedRealmHandle, propertyIndex, value, columnType, queryHandle.PrimitiveEqual);
break;
}
}
- private static void AddQueryNotEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
+ private void AddQueryNotEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
{
- var columnKey = queryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
switch (value)
{
case null:
- queryHandle.NullNotEqual(columnKey);
+ queryHandle.NullNotEqual(_realm.SharedRealmHandle, propertyIndex);
break;
case string stringValue:
- queryHandle.StringNotEqual(columnKey, stringValue, caseSensitive: true);
+ queryHandle.StringNotEqual(_realm.SharedRealmHandle, propertyIndex, stringValue, caseSensitive: true);
break;
case bool boolValue:
- queryHandle.BoolNotEqual(columnKey, boolValue);
+ queryHandle.PrimitiveNotEqual(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Bool(boolValue));
break;
case DateTimeOffset date:
- queryHandle.TimestampTicksNotEqual(columnKey, date);
+ queryHandle.PrimitiveNotEqual(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Date(date));
break;
case byte[] buffer:
if (buffer.Length == 0)
{
- // see RealmObject.SetByteArrayValue
- queryHandle.BinaryNotEqual(columnKey, (IntPtr)0x1, IntPtr.Zero);
+ // see RealmObjectBase.SetByteArrayValue
+ queryHandle.BinaryNotEqual(_realm.SharedRealmHandle, propertyIndex, (IntPtr)0x1, IntPtr.Zero);
return;
}
@@ -693,95 +694,95 @@ private static void AddQueryNotEqual(QueryHandle queryHandle, string columnName,
{
fixed (byte* bufferPtr = (byte[])value)
{
- queryHandle.BinaryNotEqual(columnKey, (IntPtr)bufferPtr, (IntPtr)buffer.Length);
+ queryHandle.BinaryNotEqual(_realm.SharedRealmHandle, propertyIndex, (IntPtr)bufferPtr, (IntPtr)buffer.Length);
}
}
break;
- case RealmObject obj:
+ case RealmObjectBase obj:
queryHandle.Not();
- queryHandle.ObjectEqual(columnKey, obj.ObjectHandle);
+ queryHandle.ObjectEqual(_realm.SharedRealmHandle, propertyIndex, obj.ObjectHandle);
break;
default:
// The other types aren't handled by the switch because of potential compiler applied conversions
- AddQueryForConvertibleTypes(columnKey, value, columnType, queryHandle.NumericNotEqualMethods);
+ AddQueryForConvertibleTypes(_realm.SharedRealmHandle, propertyIndex, value, columnType, queryHandle.PrimitiveNotEqual);
break;
}
}
- private static void AddQueryLessThan(QueryHandle queryHandle, string columnName, object value, Type columnType)
+ private void AddQueryLessThan(QueryHandle queryHandle, string columnName, object value, Type columnType)
{
- var columnKey = queryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
switch (value)
{
case DateTimeOffset date:
- queryHandle.TimestampTicksLess(columnKey, date);
+ queryHandle.PrimitiveLess(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Date(date));
break;
case string _:
case bool _:
throw new Exception($"Unsupported type {value.GetType().Name}");
default:
// The other types aren't handled by the switch because of potential compiler applied conversions
- AddQueryForConvertibleTypes(columnKey, value, columnType, queryHandle.NumericLessMethods);
+ AddQueryForConvertibleTypes(_realm.SharedRealmHandle, propertyIndex, value, columnType, queryHandle.PrimitiveLess);
break;
}
}
- private static void AddQueryLessThanOrEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
+ private void AddQueryLessThanOrEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
{
- var columnKey = queryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
switch (value)
{
case DateTimeOffset date:
- queryHandle.TimestampTicksLessEqual(columnKey, date);
+ queryHandle.PrimitiveLessEqual(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Date(date));
break;
case string _:
case bool _:
throw new Exception($"Unsupported type {value.GetType().Name}");
default:
// The other types aren't handled by the switch because of potential compiler applied conversions
- AddQueryForConvertibleTypes(columnKey, value, columnType, queryHandle.NumericLessEqualMethods);
+ AddQueryForConvertibleTypes(_realm.SharedRealmHandle, propertyIndex, value, columnType, queryHandle.PrimitiveLessEqual);
break;
}
}
- private static void AddQueryGreaterThan(QueryHandle queryHandle, string columnName, object value, Type columnType)
+ private void AddQueryGreaterThan(QueryHandle queryHandle, string columnName, object value, Type columnType)
{
- var columnKey = queryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
switch (value)
{
case DateTimeOffset date:
- queryHandle.TimestampTicksGreater(columnKey, date);
+ queryHandle.PrimitiveGreater(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Date(date));
break;
case string _:
case bool _:
throw new Exception($"Unsupported type {value.GetType().Name}");
default:
// The other types aren't handled by the switch because of potential compiler applied conversions
- AddQueryForConvertibleTypes(columnKey, value, columnType, queryHandle.NumericGreaterMethods);
+ AddQueryForConvertibleTypes(_realm.SharedRealmHandle, propertyIndex, value, columnType, queryHandle.PrimitiveGreater);
break;
}
}
- private static void AddQueryGreaterThanOrEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
+ private void AddQueryGreaterThanOrEqual(QueryHandle queryHandle, string columnName, object value, Type columnType)
{
- var columnKey = queryHandle.GetColumnKey(columnName);
+ var propertyIndex = _metadata.PropertyIndices[columnName];
switch (value)
{
case DateTimeOffset date:
- queryHandle.TimestampTicksGreaterEqual(columnKey, date);
+ queryHandle.PrimitiveGreaterEqual(_realm.SharedRealmHandle, propertyIndex, PrimitiveValue.Date(date));
break;
case string _:
case bool _:
throw new Exception($"Unsupported type {value.GetType().Name}");
default:
// The other types aren't handled by the switch because of potential compiler applied conversions
- AddQueryForConvertibleTypes(columnKey, value, columnType, queryHandle.NumericGreaterEqualMethods);
+ AddQueryForConvertibleTypes(_realm.SharedRealmHandle, propertyIndex, value, columnType, queryHandle.PrimitiveGreaterEqual);
break;
}
}
- private static void AddQueryForConvertibleTypes(ColumnKey columnKey, object value, Type columnType, QueryHandle.NumericQueryMethods queryMethods)
+ private static void AddQueryForConvertibleTypes(SharedRealmHandle realm, IntPtr propertyIndex, object value, Type columnType, Action action)
{
if (columnType.IsConstructedGenericType && columnType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
@@ -792,24 +793,39 @@ private static void AddQueryForConvertibleTypes(ColumnKey columnKey, object valu
columnType == typeof(short) ||
columnType == typeof(char) ||
columnType == typeof(int) ||
+ columnType == typeof(long) ||
columnType == typeof(RealmInteger) ||
columnType == typeof(RealmInteger) ||
- columnType == typeof(RealmInteger))
+ columnType == typeof(RealmInteger) ||
+ columnType == typeof(RealmInteger))
{
- queryMethods.Int(columnKey, (int)Convert.ChangeType(value, typeof(int)));
- }
- else if (columnType == typeof(long) ||
- columnType == typeof(RealmInteger))
- {
- queryMethods.Long(columnKey, (long)Convert.ChangeType(value, typeof(long)));
+ action(realm, propertyIndex, PrimitiveValue.Int((long)Convert.ChangeType(value, typeof(long))));
}
else if (columnType == typeof(float))
{
- queryMethods.Float(columnKey, (float)Convert.ChangeType(value, typeof(float)));
+ action(realm, propertyIndex, PrimitiveValue.Float((float)Convert.ChangeType(value, typeof(float))));
}
else if (columnType == typeof(double))
{
- queryMethods.Double(columnKey, (double)Convert.ChangeType(value, typeof(double)));
+ action(realm, propertyIndex, PrimitiveValue.Double((double)Convert.ChangeType(value, typeof(double))));
+ }
+ else if (columnType == typeof(Decimal128))
+ {
+ // This is needed, because Convert.ChangeType will throw if value is Decimal128
+ if (!(value is Decimal128 decimalValue))
+ {
+ decimalValue = (Decimal128)Convert.ChangeType(value, typeof(Decimal128));
+ }
+
+ action(realm, propertyIndex, PrimitiveValue.Decimal(decimalValue));
+ }
+ else if (columnType == typeof(decimal))
+ {
+ action(realm, propertyIndex, PrimitiveValue.Decimal((decimal)Convert.ChangeType(value, typeof(decimal))));
+ }
+ else if (columnType == typeof(ObjectId))
+ {
+ action(realm, propertyIndex, PrimitiveValue.ObjectId((ObjectId)Convert.ChangeType(value, typeof(ObjectId))));
}
else
{
@@ -825,20 +841,12 @@ private static bool GetComparisonCaseSensitive(MethodCallExpression m)
}
var comparison = (StringComparison)argument;
- bool caseSensitive;
- switch (comparison)
+ return comparison switch
{
- case StringComparison.Ordinal:
- caseSensitive = true;
- break;
- case StringComparison.OrdinalIgnoreCase:
- caseSensitive = false;
- break;
- default:
- throw new NotSupportedException($"The comparison {comparison} is not yet supported. Use {StringComparison.Ordinal} or {StringComparison.OrdinalIgnoreCase}.");
- }
-
- return caseSensitive;
+ StringComparison.Ordinal => true,
+ StringComparison.OrdinalIgnoreCase => false,
+ _ => throw new NotSupportedException($"The comparison {comparison} is not yet supported. Use {StringComparison.Ordinal} or {StringComparison.OrdinalIgnoreCase}."),
+ };
}
private string GetColumnName(MemberExpression memberExpression, ExpressionType? parentType = null)
diff --git a/Realm/Realm/MarshalHelpers.cs b/Realm/Realm/MarshalHelpers.cs
index cf67a9b13c..d08309235c 100644
--- a/Realm/Realm/MarshalHelpers.cs
+++ b/Realm/Realm/MarshalHelpers.cs
@@ -25,16 +25,6 @@ namespace Realms
{
internal class MarshalHelpers
{
- public static IntPtr BoolToIntPtr(bool value)
- {
- return value ? (IntPtr)1 : (IntPtr)0;
- }
-
- public static bool IntPtrToBool(IntPtr value)
- {
- return (IntPtr)1 == value;
- }
-
public delegate IntPtr NativeCollectionGetter(IntPtr buffer, IntPtr bufferLength, out bool isNull, out NativeException ex);
public delegate void NativeCollectionSetter(IntPtr buffer, IntPtr bufferLength, bool hasValue, out NativeException ex);
diff --git a/Realm/Realm/Native/AppConfiguration.cs b/Realm/Realm/Native/AppConfiguration.cs
new file mode 100644
index 0000000000..62de793f32
--- /dev/null
+++ b/Realm/Realm/Native/AppConfiguration.cs
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Realms.Sync.Native
+{
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct AppConfiguration
+ {
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string app_id;
+ private IntPtr app_id_len;
+
+ internal string AppId
+ {
+ set
+ {
+ app_id = value;
+ app_id_len = (IntPtr)value.Length;
+ }
+ }
+
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string base_file_path;
+ private IntPtr base_file_path_len;
+
+ internal string BaseFilePath
+ {
+ set
+ {
+ base_file_path = value;
+ base_file_path_len = (IntPtr)value.Length;
+ }
+ }
+
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string base_url;
+ private IntPtr base_url_len;
+
+ internal string BaseUrl
+ {
+ set
+ {
+ base_url = value;
+ base_url_len = (IntPtr)(value?.Length ?? 0);
+ }
+ }
+
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string local_app_name;
+ private IntPtr local_app_name_len;
+
+ internal string LocalAppName
+ {
+ set
+ {
+ local_app_name = value;
+ local_app_name_len = (IntPtr)(value?.Length ?? 0);
+ }
+ }
+
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string local_app_version;
+ private IntPtr local_app_version_len;
+
+ internal string LocalAppVersion
+ {
+ set
+ {
+ local_app_version = value;
+ local_app_version_len = (IntPtr)(value?.Length ?? 0);
+ }
+ }
+
+ internal UInt64 default_request_timeout_ms;
+
+ private MetadataPersistenceMode metadata_persistence;
+
+ [MarshalAs(UnmanagedType.U1)]
+ private bool metadata_persistence_has_value;
+
+ internal MetadataPersistenceMode? MetadataPersistence
+ {
+ set
+ {
+ metadata_persistence = value.HasValue ? value.Value : default;
+ metadata_persistence_has_value = value.HasValue;
+ }
+ }
+
+ internal LogLevel log_level;
+
+ internal IntPtr managed_log_callback;
+ }
+}
diff --git a/Realm/Realm/Native/StringValue.cs b/Realm/Realm/Native/AppError.cs
similarity index 50%
rename from Realm/Realm/Native/StringValue.cs
rename to Realm/Realm/Native/AppError.cs
index 886fe59475..ae107154b7 100644
--- a/Realm/Realm/Native/StringValue.cs
+++ b/Realm/Realm/Native/AppError.cs
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
-// Copyright 2016 Realm Inc.
+// Copyright 2020 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,16 +16,33 @@
//
////////////////////////////////////////////////////////////////////////////
+using System;
using System.Runtime.InteropServices;
+using System.Text;
namespace Realms.Sync.Native
{
[StructLayout(LayoutKind.Sequential)]
- internal struct StringValue
+ internal unsafe struct AppError
{
- internal static readonly int Size = Marshal.SizeOf();
+ [MarshalAs(UnmanagedType.U1)]
+ public bool is_null;
- [MarshalAs(UnmanagedType.LPStr)]
- public string Value;
+ private byte* message_buf;
+ private IntPtr message_len;
+
+ private byte* error_category_buf;
+ private IntPtr error_category_len;
+
+ private byte* logs_link_buf;
+ private IntPtr logs_link_len;
+
+ public int http_status_code;
+
+ public string Message => message_buf == null ? null : Encoding.UTF8.GetString(message_buf, (int)message_len);
+
+ public string ErrorCategory => error_category_buf == null ? null : Encoding.UTF8.GetString(error_category_buf, (int)error_category_len);
+
+ public string LogsLink => logs_link_buf == null ? null : Encoding.UTF8.GetString(logs_link_buf, (int)logs_link_len);
}
-}
\ No newline at end of file
+}
diff --git a/Realm/Realm/Native/MarshaledString.cs b/Realm/Realm/Native/BsonPayload.cs
similarity index 69%
rename from Realm/Realm/Native/MarshaledString.cs
rename to Realm/Realm/Native/BsonPayload.cs
index 47cef0c5a6..a2077d7c83 100644
--- a/Realm/Realm/Native/MarshaledString.cs
+++ b/Realm/Realm/Native/BsonPayload.cs
@@ -17,22 +17,21 @@
////////////////////////////////////////////////////////////////////////////
using System;
+using System.Runtime.InteropServices;
using System.Text;
+using MongoDB.Bson.Serialization;
namespace Realms.Native
{
- internal unsafe struct MarshaledString
+ [StructLayout(LayoutKind.Sequential)]
+ internal unsafe struct BsonPayload
{
-#pragma warning disable CS0649
+ private byte* serialized;
+ private IntPtr serialized_len;
- private byte* _buffer;
- private IntPtr _length;
-
-#pragma warning restore CS0649
-
- public override string ToString()
+ public T GetValue()
{
- return Encoding.UTF8.GetString(_buffer, (int)_length);
+ return BsonSerializer.Deserialize(Encoding.UTF8.GetString(serialized, (int)serialized_len));
}
}
}
diff --git a/Realm/Realm/Native/Configuration.cs b/Realm/Realm/Native/Configuration.cs
index dc5c2d539b..0e64138bcc 100644
--- a/Realm/Realm/Native/Configuration.cs
+++ b/Realm/Realm/Native/Configuration.cs
@@ -21,11 +21,11 @@
namespace Realms.Native
{
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate bool MigrationCallback(IntPtr oldRealm, IntPtr newRealm, Schema oldSchema, ulong schemaVersion, IntPtr managedMigrationHandle);
- [return: MarshalAs(UnmanagedType.I1)]
+ [return: MarshalAs(UnmanagedType.U1)]
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate bool ShouldCompactCallback(IntPtr config, ulong totalSize, ulong dataSize);
@@ -45,12 +45,12 @@ internal string Path
}
}
- [MarshalAs(UnmanagedType.I1)]
+ [MarshalAs(UnmanagedType.U1)]
internal bool read_only;
- [MarshalAs(UnmanagedType.I1)]
+ [MarshalAs(UnmanagedType.U1)]
internal bool in_memory;
- [MarshalAs(UnmanagedType.I1)]
+ [MarshalAs(UnmanagedType.U1)]
internal bool delete_if_migration_needed;
internal ulong schema_version;
@@ -61,7 +61,7 @@ internal string Path
internal ShouldCompactCallback should_compact_callback;
internal IntPtr managed_should_compact_delegate;
- [MarshalAs(UnmanagedType.I1)]
+ [MarshalAs(UnmanagedType.U1)]
internal bool enable_cache;
internal ulong max_number_of_active_versions;
diff --git a/Realm/Realm/Sync/Permissions/KeyValueCondition.cs b/Realm/Realm/Native/Credentials.cs
similarity index 52%
rename from Realm/Realm/Sync/Permissions/KeyValueCondition.cs
rename to Realm/Realm/Native/Credentials.cs
index 471394bf5d..66e3fd950d 100644
--- a/Realm/Realm/Sync/Permissions/KeyValueCondition.cs
+++ b/Realm/Realm/Native/Credentials.cs
@@ -16,27 +16,40 @@
//
////////////////////////////////////////////////////////////////////////////
-namespace Realms.Sync
+using System;
+using System.Runtime.InteropServices;
+using static Realms.Sync.Credentials;
+
+namespace Realms.Sync.Native
{
- internal class KeyValueCondition : PermissionCondition
+ internal struct Credentials
{
- public string Key { get; }
+ internal AuthProvider provider;
- public string Value { get; }
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string token;
+ private IntPtr token_len;
- public KeyValueCondition(string key, string value)
+ internal string Token
{
- Key = key;
- Value = value;
+ set
+ {
+ token = value;
+ token_len = (IntPtr)(value?.Length ?? 0);
+ }
}
- internal override object ToJsonObject()
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string password;
+ private IntPtr password_len;
+
+ internal string Password
{
- return new
+ set
{
- metadataKey = Key,
- metadataValue = Value,
- };
+ password = value;
+ password_len = (IntPtr)(value?.Length ?? 0);
+ }
}
}
-}
\ No newline at end of file
+}
diff --git a/Realm/Realm/Native/FindAndModifyOptions.cs b/Realm/Realm/Native/FindAndModifyOptions.cs
new file mode 100644
index 0000000000..447a0088fa
--- /dev/null
+++ b/Realm/Realm/Native/FindAndModifyOptions.cs
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Runtime.InteropServices;
+using Realms.Helpers;
+
+namespace Realms.Native
+{
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct FindAndModifyOptions
+ {
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string projection_buf;
+ private IntPtr projection_len;
+
+ internal string Projection
+ {
+ set
+ {
+ projection_buf = value;
+ projection_len = (IntPtr)(value?.Length ?? 0);
+ }
+ }
+
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string sort_buf;
+ private IntPtr sort_len;
+
+ internal string Sort
+ {
+ set
+ {
+ sort_buf = value;
+ sort_len = (IntPtr)(value?.Length ?? 0);
+ }
+ }
+
+ [MarshalAs(UnmanagedType.U1)]
+ private bool upsert;
+
+ [MarshalAs(UnmanagedType.U1)]
+ private bool return_new_document;
+
+ private Int64 limit;
+
+ public static FindAndModifyOptions Find(object projection, object sort, Int64? limit = null)
+ {
+ var result = new FindAndModifyOptions(projection, sort);
+ if (limit.HasValue)
+ {
+ result.limit = limit.Value;
+ }
+
+ return result;
+ }
+
+ public static FindAndModifyOptions FindAndModify(object projection, object sort, bool upsert = false, bool returnNewDocument = false)
+ {
+ var result = new FindAndModifyOptions(projection, sort);
+ result.upsert = upsert;
+ result.return_new_document = returnNewDocument;
+ return result;
+ }
+
+ private FindAndModifyOptions(object projection, object sort)
+ {
+ projection_buf = projection?.ToNativeJson();
+ projection_len = projection_buf.IntPtrLength();
+
+ sort_buf = sort?.ToNativeJson();
+ sort_len = sort_buf.IntPtrLength();
+
+ upsert = false;
+ return_new_document = false;
+ limit = 0;
+ }
+ }
+}
diff --git a/Realm/Realm/Native/HttpClientTransport.cs b/Realm/Realm/Native/HttpClientTransport.cs
new file mode 100644
index 0000000000..68b0266e38
--- /dev/null
+++ b/Realm/Realm/Native/HttpClientTransport.cs
@@ -0,0 +1,232 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2020 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Net.Http;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Realms.Sync.Native;
+
+namespace Realms.Native
+{
+ internal static class HttpClientTransport
+ {
+ private enum CustomErrorCode
+ {
+ NoError = 0,
+ UnknownHttp = 998,
+ Unknown = 999,
+ Timeout = 1000,
+ }
+
+#pragma warning disable SA1300 // Element should begin with upper-case letter
+#pragma warning disable IDE1006 // Naming Styles
+
+ private enum NativeHttpMethod
+ {
+ get,
+ post,
+ patch,
+ put,
+ del
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ private unsafe struct HttpClientRequest
+ {
+ public NativeHttpMethod method;
+
+ private byte* url_buf;
+ private IntPtr url_len;
+
+ public UInt64 timeout_ms;
+
+ public IntPtr /* StringStringPair[] */ headers;
+ public int headers_len;
+
+ private byte* body_buf;
+ private IntPtr body_len;
+
+ public string Url => Encoding.UTF8.GetString(url_buf, (int)url_len);
+
+ public string Body => Encoding.UTF8.GetString(body_buf, (int)body_len);
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ private struct HttpClientResponse
+ {
+ public Int32 http_status_code;
+
+ public CustomErrorCode custom_status_code;
+
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string body;
+ private IntPtr body_len;
+
+ public string Body
+ {
+ set
+ {
+ body = value;
+ body_len = (IntPtr)value.Length;
+ }
+ }
+ }
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void execute_request(HttpClientRequest request, IntPtr callback_ptr);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_http_transport_install_callbacks", CallingConvention = CallingConvention.Cdecl)]
+ private static extern void install_callbacks(execute_request execute);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "realm_http_transport_respond", CallingConvention = CallingConvention.Cdecl)]
+ private static extern void respond(
+ HttpClientResponse response,
+ [MarshalAs(UnmanagedType.LPArray), In] StringStringPair[] headers, int headers_len,
+ IntPtr callback_ptr);
+
+#pragma warning restore IDE1006 // Naming Styles
+#pragma warning restore SA1300 // Element should begin with upper-case letter
+
+ private static readonly HttpClient _httpClient = new HttpClient();
+
+ internal static void Install()
+ {
+ execute_request execute = ExecuteRequest;
+
+ GCHandle.Alloc(execute);
+
+ install_callbacks(execute);
+ }
+
+ [MonoPInvokeCallback(typeof(execute_request))]
+ private static async void ExecuteRequest(HttpClientRequest request, IntPtr callback)
+ {
+ try
+ {
+ try
+ {
+ using var message = new HttpRequestMessage(request.method.ToHttpMethod(), request.Url);
+ foreach (var header in StringStringPair.UnmarshalDictionary(request.headers, request.headers_len))
+ {
+ message.Headers.TryAddWithoutValidation(header.Key, header.Value);
+ }
+
+ if (request.method != NativeHttpMethod.get)
+ {
+ message.Content = new StringContent(request.Body, Encoding.UTF8, "application/json");
+ }
+
+ using var cts = new CancellationTokenSource();
+ cts.CancelAfter((int)request.timeout_ms);
+
+ var response = await _httpClient.SendAsync(message, cts.Token);
+ var headers = new List(response.Headers.Count());
+ foreach (var header in response.Headers)
+ {
+ headers.Add(new StringStringPair
+ {
+ Key = header.Key,
+ Value = header.Value.FirstOrDefault()
+ });
+ }
+
+ foreach (var header in response.Content.Headers)
+ {
+ headers.Add(new StringStringPair
+ {
+ Key = header.Key,
+ Value = header.Value.FirstOrDefault()
+ });
+ }
+
+ var nativeResponse = new HttpClientResponse
+ {
+ http_status_code = (int)response.StatusCode,
+ Body = await response.Content.ReadAsStringAsync(),
+ };
+
+ respond(nativeResponse, headers.ToArray(), headers.Count, callback);
+ }
+ catch (HttpRequestException rex)
+ {
+ var sb = new StringBuilder("An unexpected error occurred while sending the request");
+
+ // We're doing this because the message for the top-level exception is usually pretty useless.
+ // If there's inner exception, we want to skip it and directly go for the more specific messages.
+ var innerEx = rex.InnerException ?? rex;
+ while (innerEx != null)
+ {
+ sb.Append($": {innerEx.Message}");
+ innerEx = innerEx.InnerException;
+ }
+
+ var nativeResponse = new HttpClientResponse
+ {
+ custom_status_code = CustomErrorCode.UnknownHttp,
+ Body = sb.ToString(),
+ };
+
+ respond(nativeResponse, null, 0, callback);
+ }
+ catch (TaskCanceledException)
+ {
+ var nativeResponse = new HttpClientResponse
+ {
+ custom_status_code = CustomErrorCode.Timeout,
+ Body = $"Operation failed to complete within {request.timeout_ms} ms.",
+ };
+
+ respond(nativeResponse, null, 0, callback);
+ }
+ catch (Exception ex)
+ {
+ var nativeResponse = new HttpClientResponse
+ {
+ custom_status_code = CustomErrorCode.Unknown,
+ Body = ex.Message,
+ };
+
+ respond(nativeResponse, null, 0, callback);
+ }
+ }
+ catch (Exception outerEx)
+ {
+ Debug.WriteLine($"Unexpected error occurred while trying to respond to a request: {outerEx}");
+ }
+ }
+
+ private static HttpMethod ToHttpMethod(this NativeHttpMethod nativeMethod)
+ {
+ return nativeMethod switch
+ {
+ NativeHttpMethod.get => HttpMethod.Get,
+ NativeHttpMethod.post => HttpMethod.Post,
+ NativeHttpMethod.patch => new HttpMethod("PATCH"),
+ NativeHttpMethod.put => HttpMethod.Put,
+ NativeHttpMethod.del => HttpMethod.Delete,
+ _ => throw new NotSupportedException($"Unsupported HTTP method: {nativeMethod}")
+ };
+ }
+ }
+}
diff --git a/Realm/Realm/Native/NativeChangeSet.cs b/Realm/Realm/Native/NativeChangeSet.cs
deleted file mode 100644
index 8c97574e84..0000000000
--- a/Realm/Realm/Native/NativeChangeSet.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-//
-// Copyright 2019 Realm Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////
-
-using System.Runtime.InteropServices;
-using Realms.Native;
-
-namespace Realms.Server.Native
-{
- [StructLayout(LayoutKind.Sequential)]
- internal struct NativeChangeSet
- {
- public MarshaledString class_name;
-
- public MarshaledVector deletions;
- public MarshaledVector insertions;
- public MarshaledVector modifications;
-
- public string ClassName => class_name.ToString();
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct NativeModificationDetails
- {
- public ObjectKey obj;
-
- public MarshaledVector changed_columns;
- }
-}
diff --git a/Realm/Realm/Native/NativeCommon.cs b/Realm/Realm/Native/NativeCommon.cs
index 80ff027f0e..1fab54a5be 100644
--- a/Realm/Realm/Native/NativeCommon.cs
+++ b/Realm/Realm/Native/NativeCommon.cs
@@ -61,21 +61,14 @@ internal static unsafe void Initialize()
{
try
{
- var osVersionPI = typeof(Environment).GetProperty("OSVersion");
- var platformPI = osVersionPI?.PropertyType.GetProperty("Platform");
- var assemblyLocationPI = typeof(Assembly).GetProperty("Location", BindingFlags.Public | BindingFlags.Instance);
- if (osVersionPI != null && osVersionPI != null && assemblyLocationPI != null)
- {
- var osVersion = osVersionPI.GetValue(null);
- var platform = platformPI.GetValue(osVersion);
+ var platform = Environment.OSVersion.Platform;
- if (platform.ToString() == "Win32NT")
- {
- var assemblyLocation = Path.GetDirectoryName((string)assemblyLocationPI.GetValue(typeof(NativeCommon).GetTypeInfo().Assembly));
- var architecture = Environment.Is64BitProcess ? "x64" : "x86";
- var path = Path.Combine(assemblyLocation, "lib", "win32", architecture) + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH");
- Environment.SetEnvironmentVariable("PATH", path);
- }
+ if (platform == PlatformID.Win32NT)
+ {
+ var assemblyLocation = Path.GetDirectoryName(typeof(NativeCommon).GetTypeInfo().Assembly.Location);
+ var architecture = Environment.Is64BitProcess ? "x64" : "x86";
+ var path = Path.Combine(assemblyLocation, "lib", "win32", architecture) + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH");
+ Environment.SetEnvironmentVariable("PATH", path);
}
}
catch
diff --git a/Realm/Realm/Native/NativeException.cs b/Realm/Realm/Native/NativeException.cs
index d45f708987..b8c497d65b 100644
--- a/Realm/Realm/Native/NativeException.cs
+++ b/Realm/Realm/Native/NativeException.cs
@@ -54,5 +54,16 @@ internal void ThrowIfNecessary(Func overrider =
throw Convert(overrider);
}
+
+ internal void ThrowIfNecessary(GCHandle handleToFree)
+ {
+ if (type == RealmExceptionCodes.NoError)
+ {
+ return;
+ }
+
+ handleToFree.Free();
+ throw Convert();
+ }
}
}
\ No newline at end of file
diff --git a/Realm/Realm/Native/PrimitiveValue.cs b/Realm/Realm/Native/PrimitiveValue.cs
index daa370ea1f..b727e23feb 100644
--- a/Realm/Realm/Native/PrimitiveValue.cs
+++ b/Realm/Realm/Native/PrimitiveValue.cs
@@ -1,4 +1,4 @@
-////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
//
// Copyright 2017 Realm Inc.
//
@@ -18,119 +18,279 @@
using System;
using System.Runtime.InteropServices;
+using MongoDB.Bson;
using Realms.Helpers;
using Realms.Schema;
namespace Realms.Native
{
[StructLayout(LayoutKind.Explicit)]
- internal struct PrimitiveValue
+ internal unsafe struct PrimitiveValue
{
[FieldOffset(0)]
[MarshalAs(UnmanagedType.U1)]
- internal PropertyType type;
+ private bool bool_value;
- [FieldOffset(1)]
- [MarshalAs(UnmanagedType.I1)]
- internal bool has_value;
+ [FieldOffset(0)]
+ private long int_value;
- [FieldOffset(8)]
- [MarshalAs(UnmanagedType.I1)]
- internal bool bool_value;
+ [FieldOffset(0)]
+ private float float_value;
- [FieldOffset(8)]
- internal long int_value;
+ [FieldOffset(0)]
+ private double double_value;
- [FieldOffset(8)]
- internal float float_value;
+ [FieldOffset(0)]
+ private fixed ulong decimal_bits[2];
+
+ [FieldOffset(0)]
+ private fixed byte object_id_bytes[12];
+ // Without this padding, .NET fails to marshal the decimal_bits array correctly and the second element is always 0.
[FieldOffset(8)]
- internal double double_value;
+ [Obsolete("Don't use, please!")]
+ private long dontuse;
- public static PrimitiveValue Create(T value, PropertyType type)
+ [FieldOffset(16)]
+ [MarshalAs(UnmanagedType.U1)]
+ public PropertyType Type;
+
+ [FieldOffset(17)]
+ [MarshalAs(UnmanagedType.U1)]
+ private bool has_value;
+
+ public static PrimitiveValue Bool(bool value)
+ {
+ return new PrimitiveValue
+ {
+ Type = PropertyType.Bool,
+ has_value = true,
+ bool_value = value
+ };
+ }
+
+ public static PrimitiveValue NullableBool(bool? value) => new PrimitiveValue
+ {
+ Type = PropertyType.NullableBool,
+ has_value = value.HasValue,
+ bool_value = value.GetValueOrDefault()
+ };
+
+ public static PrimitiveValue Int(long value) => new PrimitiveValue
+ {
+ Type = PropertyType.Int,
+ has_value = true,
+ int_value = value
+ };
+
+ public static PrimitiveValue NullableInt(long? value) => new PrimitiveValue
+ {
+ Type = PropertyType.NullableInt,
+ has_value = value.HasValue,
+ int_value = value.GetValueOrDefault()
+ };
+
+ public static PrimitiveValue Float(float value) => new PrimitiveValue
+ {
+ Type = PropertyType.Float,
+ has_value = true,
+ float_value = value
+ };
+
+ public static PrimitiveValue NullableFloat(float? value) => new PrimitiveValue
+ {
+ Type = PropertyType.NullableFloat,
+ has_value = value.HasValue,
+ float_value = value.GetValueOrDefault()
+ };
+
+ public static PrimitiveValue Double(double value) => new PrimitiveValue
+ {
+ Type = PropertyType.Double,
+ has_value = true,
+ double_value = value
+ };
+
+ public static PrimitiveValue NullableDouble(double? value) => new PrimitiveValue
+ {
+ Type = PropertyType.NullableDouble,
+ has_value = value.HasValue,
+ double_value = value.GetValueOrDefault()
+ };
+
+ public static PrimitiveValue Date(DateTimeOffset value) => new PrimitiveValue
+ {
+ Type = PropertyType.Date,
+ has_value = true,
+ int_value = value.ToUniversalTime().Ticks
+ };
+
+ public static PrimitiveValue NullableDate(DateTimeOffset? value) => new PrimitiveValue
+ {
+ Type = PropertyType.NullableDate,
+ has_value = value.HasValue,
+ int_value = value.GetValueOrDefault().ToUniversalTime().Ticks
+ };
+
+ public static PrimitiveValue Decimal(Decimal128 value)
{
var result = new PrimitiveValue
{
- type = type,
+ Type = PropertyType.Decimal,
has_value = true
};
- switch (type)
+ result.decimal_bits[0] = value.GetIEEELowBits();
+ result.decimal_bits[1] = value.GetIEEEHighBits();
+
+ return result;
+ }
+
+ public static PrimitiveValue NullableDecimal(Decimal128? value)
+ {
+ var result = new PrimitiveValue
+ {
+ Type = PropertyType.NullableDecimal,
+ has_value = value.HasValue
+ };
+
+ if (value.HasValue)
{
- case PropertyType.Bool:
- result.bool_value = Operator.Convert(value);
- break;
- case PropertyType.Bool | PropertyType.Nullable:
- var boolValue = Operator.Convert(value);
- result.has_value = boolValue.HasValue;
- result.bool_value = boolValue.GetValueOrDefault();
- break;
- case PropertyType.Int:
- result.int_value = Operator.Convert(value);
- break;
- case PropertyType.Int | PropertyType.Nullable:
- var longValue = Operator.Convert(value);
- result.has_value = longValue.HasValue;
- result.int_value = longValue.GetValueOrDefault();
- break;
- case PropertyType.Float:
- result.float_value = Operator.Convert(value);
- break;
- case PropertyType.Float | PropertyType.Nullable:
- var floatValue = Operator.Convert(value);
- result.has_value = floatValue.HasValue;
- result.float_value = floatValue.GetValueOrDefault();
- break;
- case PropertyType.Double:
- result.double_value = Operator.Convert(value);
- break;
- case PropertyType.Double | PropertyType.Nullable:
- var doubleValue = Operator.Convert(value);
- result.has_value = doubleValue.HasValue;
- result.double_value = doubleValue.GetValueOrDefault();
- break;
- case PropertyType.Date:
- result.int_value = Operator.Convert(value).ToUniversalTime().Ticks;
- break;
- case PropertyType.Date | PropertyType.Nullable:
- var dateValue = Operator.Convert(value);
- result.has_value = dateValue.HasValue;
- result.int_value = dateValue.GetValueOrDefault().ToUniversalTime().Ticks;
- break;
- default:
- throw new NotSupportedException($"PrimitiveType {type} is not supported.");
+ result.decimal_bits[0] = value.Value.GetIEEELowBits();
+ result.decimal_bits[1] = value.Value.GetIEEEHighBits();
}
return result;
}
- public T Get()
+ public static PrimitiveValue ObjectId(ObjectId value)
+ {
+ var result = new PrimitiveValue
+ {
+ Type = PropertyType.ObjectId,
+ has_value = true
+ };
+
+ var objectIdBytes = value.ToByteArray();
+ for (var i = 0; i < 12; i++)
+ {
+ result.object_id_bytes[i] = objectIdBytes[i];
+ }
+
+ return result;
+ }
+
+ public static PrimitiveValue NullableObjectId(ObjectId? value)
+ {
+ var result = new PrimitiveValue
+ {
+ Type = PropertyType.NullableObjectId,
+ has_value = value.HasValue
+ };
+
+ if (value.HasValue)
+ {
+ var objectIdBytes = value.Value.ToByteArray();
+ for (var i = 0; i < 12; i++)
+ {
+ result.object_id_bytes[i] = objectIdBytes[i];
+ }
+ }
+
+ return result;
+ }
+
+ public static PrimitiveValue Create(T value, PropertyType type)
+ {
+ return type switch
+ {
+ PropertyType.Bool => Bool(Operator.Convert(value)),
+ PropertyType.NullableBool => NullableBool(Operator.Convert(value)),
+ PropertyType.Int => Int(Operator.Convert