void pd_PictureDownloadStatusChanged(PictureDownload sender) { this.Invoke((Action) delegate { SetStatus(sender.Status); }); }
void pd_PictureDownloadProgressChanged(PictureDownload sender) { this.Invoke((Action) delegate { pbDownloadProgress.Value = sender.DownloadProgress; }); }
public void SetPicture(PictureDownload pd) { this.CurrentPicture = pd; CurrentPicture.PictureDownloadStatusChanged += pd_PictureDownloadStatusChanged; CurrentPicture.PictureDownloadProgressChanged += pd_PictureDownloadProgressChanged; this.Invoke((Action) delegate { lblFileName.Text = Path.GetFileName(pd.Picture.LocalPath); SetStatus(pd.Status); }); }
void t_Tick(object sender, EventArgs e) { if (lastindex >= pl.Pictures.Count) { lastindex = 0; } PictureDownload pd = DownloadManager.Current.GetPicture(pl.Pictures[lastindex], false); pd.PictureDownloaded += pd_PictureDownloaded; pd.StartDownload(); lastindex++; }
void Current_PictureAddedToQueue(PictureDownload sender) { if (pictureStatusList.ContainsKey(sender)) { return; } this.Invoke((Action) delegate { PictureStatus ps = new PictureStatus(); flpDownloads.Controls.Add(ps); ps.Dock = DockStyle.Top; pictureStatusList.Add(sender, ps); ps.SetPicture(sender); }); }
void Current_PictureRemovedFromQueue(PictureDownload sender) { lock (pictureStatusList) { if (!pictureStatusList.ContainsKey(sender)) { return; } this.Invoke((Action) delegate { PictureStatus ps = pictureStatusList[sender]; ps.UnhookEvents(); flpDownloads.Controls.Remove(ps); pictureStatusList.Remove(sender); }); } }
void Current_QueueIsEmpty(PictureDownload sender) { this.Invoke((Action) delegate { }); }
void pd_PictureDownloaded(PictureDownload sender) { pb1.SizeMode = PictureBoxSizeMode.Zoom; pb1.ImageLocation = sender.Picture.LocalPath; }