示例#1
0
        public RemoteStore(string endpoint)
        {
            sync = new RemoteSyncDetails(null, false);
            ConfigureEndPoint(endpoint);

            var syncdetails = service.LoadSyncSession();

            sync = syncdetails.Cast<RemoteSyncDetails>();
            sync.Service = service;
        }
示例#2
0
        public override ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever)
        {
            System.Diagnostics.Debug.WriteLine("GetChangeBatch:" + destinationKnowledge.ToString());
            changeDataRetriever = this;

            ChangeBatchTransfer batch = (ChangeBatchTransfer)service.GetChanges(batchSize, destinationKnowledge, sync.Cast<LocalSyncDetails>()).ByteArrayToObject();

            ChangeBatch changeBatch = batch.ChangeBatch;
            changeDataRetriever = batch.ChangeDataRetriever;

            changeDataRetriever = changeDataRetriever.Cast<RemoteSyncDetails>();
            sync = changeDataRetriever.Cast<RemoteSyncDetails>();

            ((RemoteSyncDetails)(changeDataRetriever)).Service = service;
            return changeBatch;
        }
示例#3
0
        public override void ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics)
        {
            ItemsChangeInfo localVersions = null;

            try {
                localVersions = Proxy.GetChanges(Path, sourceChanges, _filters);
            }
            catch (Exception ex) {
                throw ex;
            }

            // Now we call the change applier
            // The change applier will compare the local and remote versions, apply
            // non-conflicting changes, and will also detect conflicts and react as specified
            ForgottenKnowledge = new ForgottenKnowledge(IdFormats, SyncKnowledge);
            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(IdFormats);

            changeApplier.ApplyChanges(resolutionPolicy, sourceChanges, changeDataRetriever as IChangeDataRetriever, RemoteSyncDetails.GenerateChanges(localVersions),
                                       SyncKnowledge.Clone(), ForgottenKnowledge, this, SyncSessionContext, syncCallbacks);
        }