void imageDownloader_ImageDownloaded(object sender, ImageDownloadedEventArgs e) { if (sender == primaryDownloader) OnPrimaryImageDownloaded(e); else OnSecondaryImageDownloaded(e); }
protected virtual void OnImageDownloaded(ImageDownloadedEventArgs e) { var imageDownloaded = ImageDownloaded; if (imageDownloaded != null) imageDownloaded(this, e); }
private void downloader_SecondaryImageDownloaded(object sender, ImageDownloadedEventArgs e) { if (InvokeRequired) { BeginInvoke(new MethodInvoker(delegate() { downloader_SecondaryImageDownloaded(sender, e); })); return; } if (sender != downloader) return; Panel imagePanel = createImagePanel(e.Image); screensPanel.Controls.Add(imagePanel); }