Exemple #1
0
        private async void DownloadComplete(object sender, EventArgs e)
        {
            DownloadControl control = null;

            if (sender is DownloadControl)
            {
                control = sender as DownloadControl;
            }
            if (control == null)
            {
                return;
            }
            control.Episode.Downloaded = true;
            if (/*_CameFromControlList
                 * &&*/!string.IsNullOrEmpty(control.Episode.GUID))
            {
                var episode = Subscriptions.GetEpisodeFromGuid(control.Episode.GUID);
                if (episode != null)
                {
                    episode.Downloaded     = true;
                    episode.LocalFilePath  = control.Episode.LocalFilePath;
                    episode.LocalFileToken = control.Episode.LocalFileToken;
                }
            }
            await Task.Delay(1000);

            await RemoveDownloadControlAsync(control);

            control.Dispose();
        }
Exemple #2
0
        private async Task RemoveDownloadControlAsync(DownloadControl control)
        {
            await Task.Delay(1000);

            MainStackPanel.Children.Remove(control);
            control.Dispose();
            if (MainStackPanel.Children.Count == 0)
            {
                FinishAllDownloads();
            }
        }
Exemple #3
0
        private async void DownloadCancelled(object sender, EventArgs e)
        {
            DownloadControl control = null;

            if (sender is DownloadControl)
            {
                control = sender as DownloadControl;
            }
            if (control == null)
            {
                return;
            }
            await RemoveDownloadControlAsync(control);

            control.Dispose();
        }