Example #1
0
        /// <summary>
        /// Runs asynchonously until the reporting service has finished processing the download request.
        /// </summary>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>The <see cref="ReportingOperationStatus"/> of this method is available when the Task completes.</returns>
        /// <exception cref="FaultException{TDetail}">Thrown if a fault is returned from the Bing Ads service.</exception>
        /// <exception cref="OAuthTokenRequestException">Thrown if tokens can't be refreshed due to an error received from the Microsoft Account authorization server.</exception>
        public async Task <ReportingOperationStatus> TrackAsync(CancellationToken cancellationToken)
        {
            if (FinalStatus == null)
            {
                var tracker = new ReportingOperationTracker(_statusProvider, _reportingServiceClient, cancellationToken, StatusPollIntervalInMilliseconds);

                FinalStatus = await tracker.TrackResultFileAsync().ConfigureAwait(false);
            }

            return(FinalStatus);
        }
        /// <summary>
        /// Runs asynchonously until the reporting service has finished processing the download request.
        /// </summary>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>The <see cref="ReportingOperationStatus"/> of this method is available when the Task completes.</returns>
        /// <exception cref="FaultException{TDetail}">Thrown if a fault is returned from the Bing Ads service.</exception>
        /// <exception cref="OAuthTokenRequestException">Thrown if tokens can't be refreshed due to an error received from the Microsoft Account authorization server.</exception> 
        public async Task<ReportingOperationStatus> TrackAsync(CancellationToken cancellationToken)
        {
            if (FinalStatus == null)
            {
                var tracker = new ReportingOperationTracker(_statusProvider, _reportingServiceClient, cancellationToken, StatusPollIntervalInMilliseconds);

                FinalStatus = await tracker.TrackResultFileAsync().ConfigureAwait(false);
            }

            return FinalStatus;
        }