示例#1
0
 public DownloadWidget(DownloadInfo di)
     : this()
 {
     this.di             = di;
     this.labelName.Text = String.Format("{0} ({1}) - {2}",
                                         di.Link.Parent.Name,
                                         di.Link.Parent.LanguageText,
                                         di.Link.Provider.ID);
 }
 public DownloadWidget(DownloadInfo di)
     : this()
 {
     this.di = di;
     this.labelName.Text = String.Format("{0} ({1}) - {2}",
         di.Link.Parent.Name,
         di.Link.Parent.LanguageText,
         di.Link.Provider.ID);
 }
 public void Download(DownloadInfo di, IDownloadProgress dpClient)
 {
     stop = false;
     this.dpClient = dpClient;
     this.di = di;
      if (di.Link.ScrapState == LinkScrapState.FullyLoaded)
         OnScrapVideoDetailsCompleted(di.Link);
     else
         new ScraperService().ScrapVideosDetailsAsync(this, di.Link);
 }
示例#4
0
 public void UpdateProgress(DownloadInfo di, DownloadProgressChangedEventArgs e)
 {
     foreach (DownloadWidget cnt in this.flowLayoutPanel.Controls)
     {
         if (cnt.Info == di)
         {
             cnt.UpdateStatus(e);
             return;
         }
     }
 }
 public void UpdateProgress(DownloadInfo di, DownloadProgressChangedEventArgs e)
 {
     foreach (DownloadWidget cnt in this.flowLayoutPanel.Controls)
     {
         if (cnt.Info == di)
         {
             cnt.UpdateStatus(e);
             return;
         }
     }
 }
示例#6
0
 public void Download(DownloadInfo di, IDownloadProgress dpClient)
 {
     stop          = false;
     this.dpClient = dpClient;
     this.di       = di;
     if (di.Link.ScrapState == LinkScrapState.FullyLoaded)
     {
         OnScrapVideoDetailsCompleted(di.Link);
     }
     else
     {
         new ScraperService().ScrapVideosDetailsAsync(this, di.Link);
     }
 }
        public void UpdateCompletion(DownloadInfo di, AsyncCompletedEventArgs e)
        {
            if (e.Cancelled)
                return;

            foreach (DownloadWidget cnt in this.flowLayoutPanel.Controls)
            {
                if (cnt.Info == di)
                {
                    cnt.UpdateCompletion(e.Error);
                    return;
                }
            }
        }
示例#8
0
        public void UpdateCompletion(DownloadInfo di, AsyncCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                return;
            }

            foreach (DownloadWidget cnt in this.flowLayoutPanel.Controls)
            {
                if (cnt.Info == di)
                {
                    cnt.UpdateCompletion(e.Error);
                    return;
                }
            }
        }
示例#9
0
 public void OnCompletion(DownloadInfo di, AsyncCompletedEventArgs e)
 {
     DownloadForm.UpdateCompletion(di, e);
 }
示例#10
0
 public void OnProgress(DownloadInfo di, DownloadProgressChangedEventArgs e)
 {
     DownloadForm.UpdateProgress(di, e);
 }
 public void Add(DownloadInfo di, int progress)
 {
     var widget = new DownloadWidget(di);
     this.flowLayoutPanel.Controls.Add(widget);
 }
示例#12
0
 public void OnCompletion(DownloadInfo di,AsyncCompletedEventArgs e)
 {
     DownloadForm.UpdateCompletion(di,e);
 }
示例#13
0
        private void videoLinksGalleryWidget_DownloadClicked(object sender, GalleryItemSelectedEventArgs e)
        {
            if (!Directory.Exists(AppSettings.MovieDownloadFolder))
            {
                using (var di = new FolderBrowserDialog() { Description = "Select download folder" })
                {
                    if (di.ShowDialog() == DialogResult.OK)
                        AppSettings.MovieDownloadFolder = di.SelectedPath;
                    else
                        return;
                }
            }
            {
                var link = (MovieLink)e.Data;
                var ds = new DownloaderService();
                var di = new DownloadInfo
                {
                    Link = link,
                    Service = ds
                };

                ds.Download(di, this);
                DownloadForm.ShowMe();
                DownloadForm.Add(di, 0);
            }
        }
示例#14
0
 public void OnProgress(DownloadInfo di, DownloadProgressChangedEventArgs e)
 {
     DownloadForm.UpdateProgress(di, e);
 }
示例#15
0
        public void Add(DownloadInfo di, int progress)
        {
            var widget = new DownloadWidget(di);

            this.flowLayoutPanel.Controls.Add(widget);
        }