//This is only called when the engine has detected that the destination is out of date due to Tombstone cleanup.
        public override FullEnumerationChangeBatch GetFullEnumerationChangeBatch(uint batchSize, SyncId lowerEnumerationBound, SyncKnowledge knowledgeForDataRetrieval, out object changeDataRetriever)
        {
            FullEnumerationChangeBatch batch = _metadata.GetFullEnumerationChangeBatch(batchSize, lowerEnumerationBound, knowledgeForDataRetrieval);

            changeDataRetriever = this; //this is where the transfer mechanism/protocol would go. For an in memory provider, this is sufficient
            return(batch);
        }
コード例 #2
0
ファイル: GenericSyncProvider.cs プロジェクト: alex765022/IBN
        public override FullEnumerationChangeBatch GetFullEnumerationChangeBatch(uint batchSize, SyncId lowerEnumerationBound, SyncKnowledge knowledgeForDataRetrieval, out object changeDataRetriever)
        {
            FullEnumerationChangeBatch batch = _metaData.GetFullEnumerationChangeBatch(batchSize, lowerEnumerationBound, knowledgeForDataRetrieval);

            changeDataRetriever = this;             //this is where the transfer mechanism/protocol would go. For an in memory provider, this is sufficient
            //get total item for calculating estimated work
            if (!_fullEnumFirstCall)
            {
                uint allDeletedItems;
                _metaData.GetItemCount(out RemainingSessionWorkEstimate, out allDeletedItems);
                _fullEnumFirstCall = true;
            }

            //Calculate estimate work
            batch.RemainingSessionWorkEstimate = RemainingSessionWorkEstimate;
            batch.BatchWorkEstimate            = batch.IsLastBatch ? (uint)batch.Count() : batchSize;
            RemainingSessionWorkEstimate       = batch.IsLastBatch ? 0 : RemainingSessionWorkEstimate - batchSize;

            return(batch);
        }
コード例 #3
0
        //This is only called when the engine has detected that the destination is out of date due to Tombstone cleanup.
        public override FullEnumerationChangeBatch GetFullEnumerationChangeBatch(uint batchSize, SyncId lowerEnumerationBound, SyncKnowledge knowledgeForDataRetrieval, out object changeDataRetriever)
        {
            if (!_fullEnumFirstCall)
            {
                _syncItemCount     = (uint)_store.Ids.Count;
                _fullEnumFirstCall = true;
            }
            FullEnumerationChangeBatch batch = _metadata.GetFullEnumerationChangeBatch(batchSize, lowerEnumerationBound, knowledgeForDataRetrieval);

            changeDataRetriever = this; //this is where the transfer mechanism/protocol would go. For an in memory provider, this is sufficient
            uint changesCount = 0;

            foreach (ItemChange itemChange in batch)
            {
                changesCount++;
            }
            batch.RemainingSessionWorkEstimate = _syncItemCount;
            batch.BatchWorkEstimate            = batch.IsLastBatch ? changesCount : batchSize;
            _syncItemCount = batch.IsLastBatch ? 0 : _syncItemCount - batchSize;
            return(batch);
        }