pragma warning disable 4014
This commit is contained in:
parent
05e565ff1f
commit
1f754daf1f
2 changed files with 23 additions and 19 deletions
|
|
@ -56,20 +56,22 @@ namespace RdtClient.Service.Services
|
||||||
|
|
||||||
var uri = new Uri(_download.Link);
|
var uri = new Uri(_download.Link);
|
||||||
|
|
||||||
|
#pragma warning disable 4014
|
||||||
Task.Run(async delegate
|
Task.Run(async delegate
|
||||||
{
|
#pragma warning restore 4014
|
||||||
switch (settings.DownloadClient)
|
{
|
||||||
{
|
switch (settings.DownloadClient)
|
||||||
case "Simple":
|
{
|
||||||
await DownloadSimple(uri, filePath);
|
case "Simple":
|
||||||
break;
|
await DownloadSimple(uri, filePath);
|
||||||
case "MultiPart":
|
break;
|
||||||
await DownloadMultiPart(filePath, settings);
|
case "MultiPart":
|
||||||
break;
|
await DownloadMultiPart(filePath, settings);
|
||||||
default:
|
break;
|
||||||
throw new Exception($"Unknown download client {settings.DownloadClient}");
|
default:
|
||||||
}
|
throw new Exception($"Unknown download client {settings.DownloadClient}");
|
||||||
});
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -50,13 +50,15 @@ namespace RdtClient.Service.Services
|
||||||
throw new Exception("Invalid download path");
|
throw new Exception("Invalid download path");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma warning disable 4014
|
||||||
Task.Run(async delegate
|
Task.Run(async delegate
|
||||||
{
|
#pragma warning restore 4014
|
||||||
if (!_cancelled)
|
{
|
||||||
{
|
if (!_cancelled)
|
||||||
await Unpack(filePath);
|
{
|
||||||
}
|
await Unpack(filePath);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue