public void SetThumbnail(Aurigma.GraphicsMill.Bitmap thumbnail) { if (thumbnail == null) { throw new System.ArgumentNullException("thumbnail"); } IImageList imageList = this.Parent.GetImageList(View.Thumbnails); if (!HasIcon(View.Thumbnails)) { lock (imageList) { lock (this) { if (base.Parent != null) { base.Parent.QueueManager.Remove((IQueueItem)this); } imageList.AddImage(thumbnail, this); _imageIndexKeys[View.Thumbnails] = this; } } } else { imageList.SetImage(thumbnail, this); } OnIconChanged(View.Thumbnails); }
/// <summary> /// First method associated with the item. /// It retrieves: /// object's display name, /// object's type, /// object's small icon index, /// object's small icon handle, /// object's large icon index, /// object's large icon handle. /// </summary> /// <returns>true if succeded; otherwise, false.</returns> private bool EvalMethod0() { if (this.Parent == null) { return(false); } string displayName = string.Empty; string type = string.Empty; int iconIndexSmall = -1; int iconIndexLarge = -1; System.IntPtr iconSmall = System.IntPtr.Zero; System.IntPtr iconLarge = System.IntPtr.Zero; if (FileInfoRetriever.RetrieveFileInfo(_pidl, ref displayName, ref type, ref iconIndexSmall, ref iconSmall, ref iconIndexLarge, ref iconLarge) && this.Parent != null) { IImageList listImageList = this.Parent.GetImageList(View.List); IImageList iconImageList = this.Parent.GetImageList(View.Icons); if (listImageList != null) { System.Threading.Monitor.Enter(listImageList); } try { if (iconImageList != null) { System.Threading.Monitor.Enter(iconImageList); } try { lock (this) { try { // Saving display name this.Texts[ThumbnailListItem.TextInfoIdDisplayName] = displayName; // Saving file type this.Texts[ThumbnailListItem.TextInfoIdFileType] = type; if (this.Parent != null) { // Adding small icon to control ImageList (for List & Details view) string indexKey = iconIndexSmall.ToString(); _imageIndexKeys[View.List] = indexKey; listImageList.AddImage(iconSmall, indexKey); _imageIndexKeys[View.Details] = indexKey; // Adding large icon to control ImageList (for Icon view) indexKey = iconIndexLarge.ToString(); iconImageList.AddImage(iconLarge, indexKey); _imageIndexKeys[View.Icons] = indexKey; } } finally { NativeMethods.DestroyIcon(iconSmall); NativeMethods.DestroyIcon(iconLarge); } } } finally { if (iconImageList != null) { System.Threading.Monitor.Exit(iconImageList); } } } finally { if (listImageList != null) { System.Threading.Monitor.Exit(listImageList); } } return(true); } return(false); }