protected static void DrawBorderedRectangle(Graphics g, Matrix xformWorldToPixel, RectangleF rectToDraw, Brush brush, bool erasing)
{
RectangleF xformedRect = Geometry.TransformRectangle(xformWorldToPixel, rectToDraw);
// Get a brush to fill the interior with.
Brush fillBrush;
if (erasing)
fillBrush = brush;
else
fillBrush = NormalCourseAppearance.areaHighlight;
// Draw the interior
g.FillRectangle(fillBrush, xformedRect);
// Draw the boundary.
using (Pen pen = new Pen(brush, 2)) {
g.DrawRectangle(pen, xformedRect.Left, xformedRect.Top, xformedRect.Width, xformedRect.Height);
}
}