Пример #1
0
        public async void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            ThemeConfig theme = downloadQueue.Dequeue();

            if (e.Error == null)
            {
                await Task.Run(() => ThemeManager.ExtractTheme(theme.themeName));
            }

            DownloadNext();
        }
Пример #2
0
        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();
            }
        }