public async Task UpdateDailyLeaderboardsAsync( IEnumerable <DailyLeaderboard> leaderboards, CancellationToken cancellationToken) { using (var operation = telemetryClient.StartOperation <RequestTelemetry>("Download daily leaderboards")) using (var activity = new DownloadActivity(Log, "daily leaderboards")) { try { await steamClientApiClient.ConnectAndLogOnAsync(cancellationToken).ConfigureAwait(false); steamClientApiClient.Progress = activity; var leaderboardTasks = new List <Task>(); foreach (var leaderboard in leaderboards) { var leaderboardTask = UpdateDailyLeaderboardAsync(leaderboard, cancellationToken); leaderboardTasks.Add(leaderboardTask); } await Task.WhenAll(leaderboardTasks).ConfigureAwait(false); steamClientApiClient.Progress = null; operation.Telemetry.Success = true; } catch (Exception) when(operation.Telemetry.MarkAsUnsuccessful()) { } } }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (TotalPersistentFilesNotSyncingCount < 0) { throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalPersistentFilesNotSyncingCount", 0); } if (UploadStatus != null) { UploadStatus.Validate(); } if (DownloadStatus != null) { DownloadStatus.Validate(); } if (UploadActivity != null) { UploadActivity.Validate(); } if (DownloadActivity != null) { DownloadActivity.Validate(); } if (BackgroundDataDownloadActivity != null) { BackgroundDataDownloadActivity.Validate(); } }
void ReleaseDesignerOutlets() { if (DownloadActivity != null) { DownloadActivity.Dispose(); DownloadActivity = null; } if (ImgPlace != null) { ImgPlace.Dispose(); ImgPlace = null; } if (LblPlace != null) { LblPlace.Dispose(); LblPlace = null; } }