/// <summary>
        /// Create new instance of <see cref="SyncItemCollection{T}"/>
        /// </summary>
        /// <param name="entityResponseCollection">Response collection.</param>
        internal SyncFolderItemsCollection(SyncEntityResponseCollection <T> entityResponseCollection, ExchangeService exchangeService, MailboxId mailboxId)
            : base(entityResponseCollection)
        {
            if (entityResponseCollection != null)
            {
                // if token isn't delta, then it is skip.
                if (!SyncToken.TryParseFromUrl(entityResponseCollection.ODataDeltaLink, SyncTokenType.DeltaToken, out this.syncToken))
                {
                    SyncToken.TryParseFromUrl(entityResponseCollection.ODataNextLink, SyncTokenType.SkipToken, out this.syncToken);
                }

                // Since property bag will be 'dirty' after loading
                // properties from JSON, reset change tracking since
                // latest version is already in the collection.
                entityResponseCollection.RegisterServiceAndResetChangeTracking(
                    exchangeService,
                    mailboxId);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Tries to parse value of Url query into <see cref="ISyncToken"/>
 /// </summary>
 /// <param name="url"></param>
 /// <param name="tokenType"></param>
 /// <param name="token"></param>
 /// <returns></returns>
 public static bool TryParseFromUrl(Uri url, SyncTokenType tokenType, out ISyncToken token)
 {
     return(SyncToken.TryParseFromUrl(url.Query, tokenType, out token));
 }