Пример #1
0
        /// <summary>
        /// Initializes any collection properties after deserialization, like next requests for paging.
        /// </summary>
        /// <param name="synchronizationToInitialize">The <see cref="Synchronization"/> with the collection properties to initialize.</param>
        private void InitializeCollectionProperties(Synchronization synchronizationToInitialize)
        {
            if (synchronizationToInitialize != null && synchronizationToInitialize.AdditionalData != null)
            {
                if (synchronizationToInitialize.Jobs != null && synchronizationToInitialize.Jobs.CurrentPage != null)
                {
                    synchronizationToInitialize.Jobs.AdditionalData = synchronizationToInitialize.AdditionalData;

                    object nextPageLink;
                    synchronizationToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        synchronizationToInitialize.Jobs.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }

                if (synchronizationToInitialize.Templates != null && synchronizationToInitialize.Templates.CurrentPage != null)
                {
                    synchronizationToInitialize.Templates.AdditionalData = synchronizationToInitialize.AdditionalData;

                    object nextPageLink;
                    synchronizationToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        synchronizationToInitialize.Templates.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Creates the specified Synchronization using POST.
 /// </summary>
 /// <param name="synchronizationToCreate">The Synchronization to create.</param>
 /// <returns>The created Synchronization.</returns>
 public System.Threading.Tasks.Task <Synchronization> CreateAsync(Synchronization synchronizationToCreate)
 {
     return(this.CreateAsync(synchronizationToCreate, CancellationToken.None));
 }