Example #1
0
        public async Task StartAsync()
        {
            if (Package is not null)
            {
                await downloadService.DownloadFileTaskAsync(Package);

                Package = downloadService.Package;
            }
            else
            {
                if (string.IsNullOrWhiteSpace(Filename))
                {
                    await downloadService.DownloadFileTaskAsync(Url, new DirectoryInfo(Folder));
                }
                else
                {
                    await downloadService.DownloadFileTaskAsync(Url, Path.Combine(Folder, Filename));
                }
            }
            Status = DownloadStatus.Running;
        }