Beispiel #1
0
 void pd_PictureDownloadStatusChanged(PictureDownload sender)
 {
     this.Invoke((Action) delegate
     {
         SetStatus(sender.Status);
     });
 }
Beispiel #2
0
 void pd_PictureDownloadProgressChanged(PictureDownload sender)
 {
     this.Invoke((Action) delegate
     {
         pbDownloadProgress.Value = sender.DownloadProgress;
     });
 }
Beispiel #3
0
        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);
            });
        }
Beispiel #4
0
        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++;
        }
Beispiel #5
0
        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);
            });
        }
Beispiel #6
0
        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);
                });
            }
        }
Beispiel #7
0
 void Current_QueueIsEmpty(PictureDownload sender)
 {
     this.Invoke((Action) delegate
     {
     });
 }
Beispiel #8
0
 void pd_PictureDownloaded(PictureDownload sender)
 {
     pb1.SizeMode      = PictureBoxSizeMode.Zoom;
     pb1.ImageLocation = sender.Picture.LocalPath;
 }