Exemple #1
0
        /// <summary>
        /// Gets the icon handle. It tries first the nested to get the icon handle. If that is not supported it will get it from
        /// the image list of the nested if that is supported. If neither of these is supported a default image will be shown.
        /// </summary>
        /// <returns>An object representing the icon.</returns>
        public override object GetIconHandle(bool open)
        {
            Debug.Assert(this.nestedHierarchy != null, "The nested hierarchy object must be created before calling this method");

            object iconHandle = null;

            this.nestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_IconHandle, out iconHandle);
            if (iconHandle == null)
            {
                // Try to get an icon from the nested hierrachy image list.
                if (this.nestedHierarchyImageList != 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 < this.nestedHierarchyImageList.Images.Count)
                        {
                            iconHandle = (int)PackageUtilities.GetIntPointerFromImage(this.nestedHierarchyImageList.Images[imageIndex]);
                        }
                    }
                }

                if (iconHandle == null)
                {
                    iconHandle = (int)PackageUtilities.GetIntPointerFromImage(this.ProjectMgr.ImageList.Images[(int)ProjectNode.ImageName.Application]);
                }
            }

            return(iconHandle);
        }
        // Called since the FileNode.ImageIndex returns -1 by default.
        //
        public override object GetIconHandle(bool open)
        {
            if (FileName.EndsWith(".prg", StringComparison.InvariantCultureIgnoreCase))
            {
                return(PackageUtilities.GetIntPointerFromImage(
                           XSharpProjectNode.ImageList.Images[(int)XSharpImageListIndex.Source]));
            }

            return(this.ProjectMgr.ImageHandler.GetIconHandle(this.ImageIndex));
        }
        // Called since the FileNode.ImageIndex returns -1 by default.
        //
        public override object GetIconHandle(bool open)
        {
            if (FileName.EndsWith(NemerleConstants.FileExtension, StringComparison.InvariantCultureIgnoreCase))
            {
                return(PackageUtilities.GetIntPointerFromImage(
                           NemerleProjectNode.NemerleImageList.Images[(int)NemerleConstants.ImageListIndex.NemerleSource]));
            }

            return(this.ProjectMgr.ImageHandler.GetIconHandle(this.ImageIndex));
        }
Exemple #4
0
 public override object GetIconHandle(bool open)
 {
     if (IsFormSubType)
     {
         return(PackageUtilities.GetIntPointerFromImage(this.ProjectMgr.ImageList.Images[(int)ProjectNode.ImageName.WindowsForm]));
     }
     if (this.FileName.ToLower().EndsWith(".cps"))
     {
         return(PackageUtilities.GetIntPointerFromImage(ComposeStarProjectNode.ComposeStarImageList.Images[(int)ComposeStarProjectNode.ComposeStarImageName.cpsFile]));
     }
     return(base.GetIconHandle(open));
 }
Exemple #5
0
        // Called since the FileNode.ImageIndex returns -1 by default.
        //
        public override object GetIconHandle(bool open)
        {
            if (FileName.EndsWith(NemerleConstants.FileExtension, StringComparison.InvariantCultureIgnoreCase))
            {
                int imageIndex = HasDesigner ?
                                 NemerleConstants.ImageListIndex.NemerleForm :
                                 NemerleConstants.ImageListIndex.NemerleSource;
                return
                    (PackageUtilities.GetIntPointerFromImage(NemerleProjectNode.NemerleImageList.Images[imageIndex]));
            }

            return(base.GetIconHandle(open));
        }
 public override object GetIconHandle(bool open)
 {
     return(PackageUtilities.GetIntPointerFromImage(open ? this.ProjectMgr.ImageList.Images[(int)ProjectNode.ImageName.OpenReferenceFolder] : this.ProjectMgr.ImageList.Images[(int)ProjectNode.ImageName.ReferenceFolder]));
 }
Exemple #7
0
 public override object GetIconHandle(bool open)
 {
     return(PackageUtilities.GetIntPointerFromImage(ComposeStarImageList.Images[(int)ComposeStarImageName.cpsProject]));
 }
Exemple #8
0
        public override object GetIconHandle(bool open)
        {
            var img = NemerleProjectNode.NemerleImageList.Images[NemerleConstants.ImageListIndex.NemerleMacroReferences];

            return(PackageUtilities.GetIntPointerFromImage(img));
        }
 /// <summary>
 /// Gets a handle to the icon that should be set for this node
 /// </summary>
 /// <param name="open">Whether the folder is open, ignored here.</param>
 /// <returns>Handle to icon for the node</returns>
 public override object GetIconHandle(bool open)
 {
     return(PackageUtilities.GetIntPointerFromImage(this.ProjectMgr.ImageList.Images[(int)ProjectNode.ImageName.DependentFile]));;
 }
Exemple #10
0
        public override object GetIconHandle(bool open)
        {
            int offset = (this.CanShowDefaultIcon() ? (int)ProjectNode.ImageName.Reference : (int)ProjectNode.ImageName.DanglingReference);

            return(PackageUtilities.GetIntPointerFromImage(this.ProjectMgr.ImageList.Images[offset]));
        }