Minor clean

This commit is contained in:
Kurt
2020-09-05 20:15:17 -07:00
parent 4f4483a810
commit 0203eb4017
5 changed files with 31 additions and 33 deletions

View File

@@ -70,7 +70,7 @@ private void B_Download_Click(object sender, EventArgs e)
}
private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) => PBar_MultiUse.Value = e.ProgressPercentage;
private void Completed(object sender, AsyncCompletedEventArgs e)
{
if (e.Error != null)
@@ -80,7 +80,7 @@ private void Completed(object sender, AsyncCompletedEventArgs e)
return;
}
PBar_MultiUse.Value = 100;
PBar_MultiUse.Value = 100;
L_Status.Text = "Unzipping...";
UnzipFile();
}
@@ -96,7 +96,7 @@ private async void UnzipFile()
Directory.CreateDirectory(outputFolderPath);
await Task.Run(() => ZipFile.ExtractToDirectory(ZipFilePath, outputFolderPath));
await Task.Run(() => ZipFile.ExtractToDirectory(ZipFilePath, outputFolderPath)).ConfigureAwait(false);
SetUIDownloadState(true, true);
}
@@ -137,7 +137,7 @@ private async void CheckNetworkFileSizeAsync()
try
{
using var webClient = new WebClient();
await webClient.OpenReadTaskAsync(new Uri(AllHosts[CB_HostSelect.SelectedIndex], UriKind.Absolute));
await webClient.OpenReadTaskAsync(new Uri(AllHosts[CB_HostSelect.SelectedIndex], UriKind.Absolute)).ConfigureAwait(false);
var totalSizeBytes = Convert.ToInt64(webClient.ResponseHeaders["Content-Length"]);
var totalSizeMb = totalSizeBytes / 1e+6;