//Change application!
        public byte[] ProcessRemoteChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, CachedChangeDataRetriever changeDataRetriever, byte[] changeApplierInfo)
        {
            _metadataStore.BeginTransaction();

            //Get all my local change versions from the metadata store
            IEnumerable <ItemChange> localChanges = _metadata.GetLocalVersions(sourceChanges);

            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(_idFormats);

            // The following step is required because we are remote change application
            changeApplier.LoadChangeApplierInfo(changeApplierInfo);

            changeApplier.ApplyChanges(
                resolutionPolicy,
                sourceChanges,
                changeDataRetriever,
                localChanges,
                _metadata.GetKnowledge(),
                _metadata.GetForgottenKnowledge(),
                this,
                null,                     // Note that we do not pass a sync session context
                syncCallbacks);

            _metadataStore.CommitTransaction();

            // Return the ChangeApplierInfo
            return(changeApplier.GetChangeApplierInfo());
        }
Example #2
0
 //Specify that we'd like to get batches of size 10 and what our knowledge is
 public override void GetSyncBatchParameters(out uint batchSize, out SyncKnowledge knowledge)
 {
     batchSize = 10;
     knowledge = _metadata.GetKnowledge();
 }