Example #1
0
        /// <summary>
        /// When overridden in a derived class, gets a change batch that contains item metadata for items that have IDs greater than the specified lower bound, as part of a full enumeration.
        /// </summary>
        /// <param name="batchSize">The number of changes to include in the change batch.</param>
        /// <param name="lowerEnumerationBound">The lower bound for item IDs. This method returns changes that have IDs greater than or equal to this ID value.</param>
        /// <param name="knowledgeForDataRetrieval">If an item change is contained in this knowledge object, data for that item already exists on the destination replica.</param>
        /// <param name="changeDataRetriever">Returns an object that can be used to retrieve change data. It can be an <see cref="T:Microsoft.Synchronization.IChangeDataRetriever"/> object or a be provider-specific object.</param>
        /// <returns>
        /// A change batch that contains item metadata for items that have IDs greater than the specified lower bound, as part of a full enumeration.
        /// </returns>
        public override FullEnumerationChangeBatch GetFullEnumerationChangeBatch(uint batchSize, SyncId lowerEnumerationBound, SyncKnowledge knowledgeForDataRetrieval, out object changeDataRetriever)
        {
            byte[] rawLowerEnumBound            = lowerEnumerationBound.RawId;
            byte[] rawKnowledgeForDataRetrieval = knowledgeForDataRetrieval.Serialize();
            byte[] rawChangeDataRetriever;
            byte[] rawFullEnumerationChangeBatch =
                _syncService.GetFullEnumerationChangeBatch(batchSize,
                                                           rawLowerEnumBound,
                                                           rawKnowledgeForDataRetrieval,
                                                           out rawChangeDataRetriever);
            CachedChangeDataRetriever cachedRetriever =
                SerializerHelper.BinaryDeserialize <CachedChangeDataRetriever>(rawChangeDataRetriever);

            changeDataRetriever = cachedRetriever;
            return(FullEnumerationChangeBatch.Deserialize(IdFormats, rawFullEnumerationChangeBatch));
        }