Beispiel #1
0
 private void AnyDownloader_StatusChanged(
     AbstractDownloader sender,
     DownloaderStatus status)
 {
     if (status == DownloaderStatus.Completed)
     {
         histories.Add(new DownloadHistory(
                           sender.DownloadTask.Key,
                           sender.Result.Path,
                           DateTime.Now));
         if (settingEntries.IsNotificationEnabledWhenTaskCompleted)
         {
             ToastManager.DownloaderCompletionToast(sender);
         }
     }
     else if (status == DownloaderStatus.Error)
     {
         if (settingEntries.IsNotificationEnabledWhenFailed)
         {
             ToastManager.DownloaderErrorToast(sender);
         }
     }
     else if (status == DownloaderStatus.Disposed)
     {
         sender.StatusChanged -= AnyDownloader_StatusChanged;
         downloaders.Remove(sender);
     }
 }