public override object GetIconHandle(bool open) { Debug.Assert(this.nestedHierarchy != null, "The nested hierarchy object must be created before calling this method"); ThreadHelper.ThrowIfNotOnUIThread(); object iconHandle = null; this.nestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_IconHandle, out iconHandle); if (iconHandle == null) { if (null == imageHandler) { InitImageHandler(); } // Try to get an icon from the nested hierrachy image list. if (imageHandler.ImageList != null) { object imageIndexAsObject = null; if (this.nestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_IconIndex, out imageIndexAsObject) == VSConstants.S_OK && imageIndexAsObject != null) { int imageIndex = (int)imageIndexAsObject; if (imageIndex < imageHandler.ImageList.Images.Count) { iconHandle = imageHandler.GetIconHandle(imageIndex); } } } if (null == iconHandle) { iconHandle = this.ProjectMgr.ImageHandler.GetIconHandle((int)ProjectNode.ImageName.Application); } } return(iconHandle); }