コード例 #1
0
ファイル: Downloader.cs プロジェクト: blacker-cz/MangaScraper
 protected void OnDownloadCompleted(DownloadCompletedEventArgs eventArgs)
 {
     var dcEvent = DownloadCompleted;
     if (dcEvent != null)
     {
         dcEvent(this, eventArgs);
     }
 }
コード例 #2
0
        void _downloader_DownloadCompleted(object sender, DownloadCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                CurrentActionText = "Download was cancelled.";
                State = DownloadState.Cancelled;
            }
            else if (e.Error != null)
            {
                CurrentActionText = "Unable to download/save requested chaper";
                State = DownloadState.Error;
                _log.Error("Unable to download/save requested chapter.", e.Error);
            }
            else
            {
                State = DownloadState.Ok;
                _openDownloadCommand.Disabled = false;
                _downloadInfo.Path = e.DownloadedPath;
            }

            _downloadInfo.Downloaded = DateTime.UtcNow;
            Completed = true;
            _cancelDownloadCommand.Disabled = true;
            _downloadExists = null; // reset the download exists flag

            OnDownloadCompleted();
        }