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);
}
}