ComponentFactory.Krypton.Ribbon.ViewDrawRibbonAppTab.RenderBefore C# (CSharp) Method

RenderBefore() public method

Perform rendering before child elements are rendered.
public RenderBefore ( RenderContext context ) : void
context ComponentFactory.Krypton.Toolkit.RenderContext Rendering context.
return void
        public override void RenderBefore(RenderContext context)
        {
            int memento;

            // Find the correct palette to use that matches the button state
            switch (State)
            {
                default:
                case PaletteState.Normal:
                    memento = 0;
                    break;
                case PaletteState.Tracking:
                    memento = 1;
                    break;
                case PaletteState.Tracking | PaletteState.FocusOverride:
                    memento = 2;
                    break;
                case PaletteState.Pressed:
                    memento = 3;
                    break;
            }

            // Draw the background
            _mementos[memento] = context.Renderer.RenderRibbon.DrawRibbonApplicationTab(_ribbon.RibbonShape, context, ClientRectangle, State,
                                                                                        _ribbon.RibbonAppButton.AppButtonBaseColorDark,
                                                                                        _ribbon.RibbonAppButton.AppButtonBaseColorLight,
                                                                                        _mementos[memento]);
        }