public override void DrawRibbonOverflow(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);
// Office 2010 uses the same color for both parts
if (shape == PaletteRibbonShape.Office2010)
c2 = c1;
// 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))
{
context.Graphics.DrawLine(darkPen, displayRect.Left, displayRect.Top + 1, displayRect.Left, displayRect.Top + 3);
context.Graphics.DrawLine(darkPen, displayRect.Left + 1, displayRect.Top + 2, displayRect.Left, displayRect.Top + 3);
context.Graphics.DrawLine(lightPen, displayRect.Left, displayRect.Top, displayRect.Left + 2, displayRect.Top + 2);
context.Graphics.DrawLine(lightPen, displayRect.Left + 1, displayRect.Top + 3, displayRect.Left, displayRect.Top + 4);
context.Graphics.DrawLine(darkPen, displayRect.Left + 4, displayRect.Top + 1, displayRect.Left + 4, displayRect.Top + 3);
context.Graphics.DrawLine(darkPen, displayRect.Left + 5, displayRect.Top + 2, displayRect.Left + 4, displayRect.Top + 3);
context.Graphics.DrawLine(lightPen, displayRect.Left + 4, displayRect.Top, displayRect.Left + 6, displayRect.Top + 2);
context.Graphics.DrawLine(lightPen, displayRect.Left + 5, displayRect.Top + 3, displayRect.Left + 4, displayRect.Top + 4);
}
}