//draw shape method public void DrawShape(IGraphics graphics) { DoDrawShape(graphics); if (IsSelected) { graphics.DrawBorder(TopLeftPoint, BottomRightPoint); } }
//draw Shapes public void DrawShapes(IGraphics graphics) { graphics.ClearCanvas(); foreach (Shape shape in Shapes) { shape.DrawShape(graphics); } if (operationShape != null) { operationShape.DrawShape(graphics); } }
//a virutal function to draw shape protected virtual void DoDrawShape(IGraphics graphics) { }
//draw all shapes public void DrawShapes(IGraphics graphics) { PaintModel.DrawShapes(graphics); }
//rectangle draw protected override void DoDrawShape(IGraphics graphics) { graphics.DrawRectangle(TopLeftPoint, BottomRightPoint); }