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_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); }); } }