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();
}