コード例 #1
0
        public Models.SyncState SyncUp(Models.SyncUpTarget target, Models.SyncOptions options, string soupName, string callback)
        {
            var syncUp      = JsonConvert.SerializeObject(target);
            var action      = JsonConvert.DeserializeObject <Action <SyncState> >(callback);
            var syncOptions = JsonConvert.SerializeObject(options);
            var state       = _syncManager.SyncUp(JsonConvert.DeserializeObject <SyncUpTarget>(syncUp), SyncOptions.FromJson(JObject.Parse(syncOptions)), soupName, action);
            var syncState   = JsonConvert.SerializeObject(state);

            return(JsonConvert.DeserializeObject <Models.SyncState>(syncState));
        }
コード例 #2
0
        public static SyncState CreateSyncUp(SmartStore.SmartStore store, SyncUpTarget target, SyncOptions options,
                                             string soupName)
        {
            var nativeStore   = JsonConvert.SerializeObject(store);
            var syncUpTarget  = JsonConvert.SerializeObject(target);
            var nativeOptions = JsonConvert.SerializeObject(options);
            var state         =
                SDK.SmartSync.Model.SyncState.CreateSyncUp(
                    JsonConvert.DeserializeObject <SDK.SmartStore.Store.SmartStore>(nativeStore),
                    JsonConvert.DeserializeObject <SDK.SmartSync.Model.SyncUpTarget>(syncUpTarget),
                    JsonConvert.DeserializeObject <SDK.SmartSync.Model.SyncOptions>(nativeOptions), soupName);
            var syncState = JsonConvert.SerializeObject(state);

            return(JsonConvert.DeserializeObject <SyncState>(syncState));
        }