public async void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { ThemeConfig theme = downloadQueue.Dequeue(); if (e.Error == null) { await Task.Run(() => ThemeManager.ExtractTheme(theme.themeName)); } DownloadNext(); }
public async void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { List <string> imagesZipUris = (List <string>)e.UserState; if (e.Error != null && imagesZipUris.Count > 0) { ThemeConfig theme = downloadQueue.Peek(); client.DownloadFileAsync(new Uri(imagesZipUris.First()), theme.themeName + "_images.zip", imagesZipUris.Skip(1).ToList()); } else { ThemeConfig theme = downloadQueue.Dequeue(); if (e.Error == null) { await Task.Run(() => ThemeManager.ExtractTheme(theme.themeName)); } DownloadNext(); } }