private void DrawBackground(RenderContext context,
Rectangle rect,
IPaletteBack paletteBack,
IPaletteBorder paletteBorder,
PaletteState state)
{
GraphicsPath borderPath;
Padding borderPadding;
// Ask the border renderer for a path that encloses the border
if (DrawTabBorder)
{
borderPath = context.Renderer.RenderTabBorder.GetTabBackPath(context, rect, paletteBorder, Orientation, state, TabBorderStyle);
borderPadding = Padding.Empty;
}
else
{
borderPath = context.Renderer.RenderStandardBorder.GetBackPath(context, rect, paletteBorder, Orientation, state);
borderPadding = context.Renderer.RenderStandardBorder.GetBorderRawPadding(paletteBorder, state, Orientation);
}
// Apply the padding depending on the orientation
Rectangle enclosingRect = CommonHelper.ApplyPadding(_orientation, rect, borderPadding);
// Render the background inside the border path
_mementoBack = context.Renderer.RenderStandardBack.DrawBack(context, enclosingRect, borderPath, paletteBack, _orientation, state, _mementoBack);
borderPath.Dispose();
}