ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGalleryButton.GetImage C# (CSharp) Method

GetImage() public method

Gets the content image.
public GetImage ( PaletteState state ) : Image
state PaletteState The state for which the image is needed.
return Image
        public virtual Image GetImage(PaletteState state)
        {
            // Find the correct collection of images
            GalleryButtonImages images = null;
            switch (_button)
            {
                case PaletteRibbonGalleryButton.Up:
                    images = _images.Up;
                    break;
                case PaletteRibbonGalleryButton.Down:
                    images = _images.Down;
                    break;
                case PaletteRibbonGalleryButton.DropDown:
                    images = _images.DropDown;
                    break;
            }

            // Get image based on state
            Image image = null;
            switch (State)
            {
                case PaletteState.Disabled:
                    image = images.Disabled;
                    break;
                case PaletteState.Normal:
                    image = images.Normal;
                    break;
                case PaletteState.Tracking:
                    image = images.Tracking;
                    break;
                case PaletteState.Pressed:
                    image = images.Pressed;
                    break;
            }

            // If no image then get the common image
            if (image == null)
                image = images.Common;

            // If still no image then get is from the palette
            if (image == null)
                return _palette.GetGalleryButtonImage(_button, State);
            else
                return image;
        }