private void GalleryWorker_ThumbnailAvailable(object sender, MediaFileEventArgs e) { try { if (InvokeRequired) { Invoke(new EventHandler <MediaFileEventArgs>(GalleryWorker_ThumbnailAvailable), new object[] { sender, e }); } else { if (e.File.ThumbnailImage != null && _fileCollection.ContainsKey(e.File)) { ThumbnailContainer thumbnailContainer = _fileCollection[e.File]; thumbnailContainer.SetThumbnail(e.File.ThumbnailImage, new Point(10 + (200 - e.File.ThumbnailImage.Size.Width) / 2, 10)); } } } catch (Exception ex) { FormUtilities.ShowError(ParentForm, ex); } }
private void FileSystemHandler_MediaFileUpdated(object sender, MediaFileEventArgs e) { RaiseThumbnailAvailableEvent(e.File); }