ComponentFactory.Krypton.Toolkit.RenderStandard.DrawRibbonContextArrow C# (CSharp) Method

DrawRibbonContextArrow() public method

Perform drawing of a ribbon context arrow glyph.
public DrawRibbonContextArrow ( PaletteRibbonShape shape, RenderContext context, Rectangle displayRect, IPaletteRibbonGeneral paletteGeneral, PaletteState state ) : void
shape PaletteRibbonShape Ribbon shape.
context RenderContext Render context.
displayRect System.Drawing.Rectangle Display area available for drawing.
paletteGeneral IPaletteRibbonGeneral General ribbon palette details.
state PaletteState State associated with rendering.
return void
        public override void DrawRibbonContextArrow(PaletteRibbonShape shape,
                                                    RenderContext context,
                                                    Rectangle displayRect,
                                                    IPaletteRibbonGeneral paletteGeneral,
                                                    PaletteState state)
        {
            Debug.Assert(context != null);
            Debug.Assert(paletteGeneral != null);

            // Validate parameter references
            if (context == null) throw new ArgumentNullException("context");
            if (paletteGeneral == null) throw new ArgumentNullException("paletteGeneral");

            Color c1 = paletteGeneral.GetRibbonQATButtonDark(state);
            Color c2 = paletteGeneral.GetRibbonQATButtonLight(state);

            // If disabled then convert to black and white
            if (state == PaletteState.Disabled)
            {
                c1 = CommonHelper.ColorToBlackAndWhite(c1);
                c2 = CommonHelper.ColorToBlackAndWhite(c2);
            }

            using (Pen darkPen = new Pen(c1),
                       lightPen = new Pen(c2))
            {
                if (shape == PaletteRibbonShape.Office2010)
                {
                    context.Graphics.DrawLine(darkPen, displayRect.Left - 1, displayRect.Top, displayRect.Left + 5, displayRect.Top);
                    context.Graphics.DrawLine(lightPen, displayRect.Left - 1, displayRect.Top + 1, displayRect.Left + 5, displayRect.Top + 1);
                }
                else
                {
                    context.Graphics.DrawLine(darkPen, displayRect.Left, displayRect.Top, displayRect.Left + 4, displayRect.Top);
                    context.Graphics.DrawLine(lightPen, displayRect.Left, displayRect.Top + 1, displayRect.Left + 4, displayRect.Top + 1);
                }

                context.Graphics.DrawLine(darkPen, displayRect.Left, displayRect.Top + 3, displayRect.Left + 4, displayRect.Top + 3);
                context.Graphics.DrawLine(darkPen, displayRect.Left + 1, displayRect.Top + 4, displayRect.Left + 3, displayRect.Top + 4);
                context.Graphics.DrawLine(darkPen, displayRect.Left + 2, displayRect.Top + 4, displayRect.Left + 2, displayRect.Top + 5);
                context.Graphics.DrawLine(lightPen, displayRect.Left, displayRect.Top + 4, displayRect.Left + 2, displayRect.Top + 6);
                context.Graphics.DrawLine(lightPen, displayRect.Left + 2, displayRect.Top + 6, displayRect.Left + 4, displayRect.Top + 4);
            }
        }
RenderStandard