private void RenderBefore2007ContextTab(RenderContext context, ContextTabSet cts)
{
// We only draw side separators on the first and last tab of the contexts
if (cts.IsFirstOrLastTab(this))
{
// Grab the color we draw the context separator in
Color sepColor = _paletteGeneral.GetRibbonTabSeparatorContextColor(PaletteState.Normal);
Rectangle parentRect = Parent.ClientRectangle;
Rectangle contextRect = new Rectangle(ClientRectangle.X - 1, parentRect.Y, ClientRectangle.Width + 2, parentRect.Height);
Rectangle gradientRect = new Rectangle(ClientRectangle.X - 1, parentRect.Y - 1, ClientRectangle.Width + 2, parentRect.Height + 2);
using (LinearGradientBrush sepBrush = new LinearGradientBrush(gradientRect, sepColor, Color.Transparent, 90f))
{
// We need to customize the way the color blends over the background
sepBrush.Blend = _contextBlend2007;
using (Pen sepPen = new Pen(sepBrush))
{
if (cts.IsFirstTab(this))
context.Graphics.DrawLine(sepPen, contextRect.X, contextRect.Y, contextRect.X, contextRect.Bottom - 1);
if (cts.IsLastTab(this))
context.Graphics.DrawLine(sepPen, contextRect.Right - 1, contextRect.Y, contextRect.Right - 1, contextRect.Bottom - 1);
}
}
}
}