Example #1
0
 /// <summary>
 /// Turns an image list kind / overlay into the proper index in the image list.
 /// </summary>
 private static int GetImageListIndex(ImageListKind kind, ImageListOverlay overlay)
 {
     if ((int)kind <= 30)
     {
         int groupBase = (int)kind * 6;
         return(groupBase + (int)overlay);
     }
     return((int)kind);
 }
Example #2
0
        /// <summary>
        /// Gets the image which is associated with the given index for the
        /// given combo box.
        /// </summary>
        public int GetEntryImage(int iCombo, int iIndex, out int piImageIndex)
        {
            piImageIndex = 0;

            var curNav = GetNavigation(iCombo);

            if (curNav != null && iIndex < curNav.Children.Length)
            {
                var child = curNav.Children[iIndex];

                ImageListOverlay overlay = ImageListOverlay.ImageListOverlayNone;
                string           name    = child.Name;
                if (name != null && name.StartsWithOrdinal("_") &&
                    !(name.StartsWithOrdinal("__") && name.EndsWithOrdinal("__")))
                {
                    overlay = ImageListOverlay.ImageListOverlayPrivate;
                }

                ImageListKind kind;
                switch (child.Kind)
                {
                case NavigationKind.Class: kind = ImageListKind.Class; break;

                case NavigationKind.Function: kind = ImageListKind.Method; break;

                case NavigationKind.ClassMethod: kind = ImageListKind.ClassMethod; break;

                case NavigationKind.Property: kind = ImageListKind.Property; break;

                case NavigationKind.StaticMethod: kind = ImageListKind.StaticMethod; break;

                default: kind = ImageListKind.ThreeDashes; break;
                }

                piImageIndex = GetImageListIndex(kind, overlay);
            }

            return(VSConstants.S_OK);
        }
Example #3
0
 /// <summary>
 /// Turns an image list kind / overlay into the proper index in the image list.
 /// </summary>
 internal static int GetImageListIndex(ImageListKind kind, ImageListOverlay overlay)
 {
     return ((int)kind) * 6 + (int)overlay;
 }
Example #4
0
 /// <summary>
 /// Turns an image list kind / overlay into the proper index in the image list.
 /// </summary>
 private static int GetImageListIndex(ImageListKind kind, ImageListOverlay overlay)
 {
     return(((int)kind) * 6 + (int)overlay);
 }