/// <summary>
/// Draws the shape.
/// </summary>
/// <param name="G">The g.</param>
/// <param name="FillShape">The fill shape.</param>
/// <param name="DrawShape">The draw shape.</param>
/// <exception cref="ArgumentOutOfRangeException">
/// FillModes - null
/// or
/// FillModes - null
/// or
/// ShapeTypes - null
/// </exception>
public void DrawShape(System.Drawing.Graphics G, Brush FillShape, Pen DrawShape)
{
foreach (List <Point> points in Points)
{
switch (ShapeType)
{
case ShapeTypes.Polygon:
switch (FillMode)
{
case FillModes.Fill:
G.FillPolygon(FillShape, points.ToArray());
break;
case FillModes.Border:
G.DrawPolygon(DrawShape, points.ToArray());
break;
case FillModes.Both:
G.FillPolygon(FillShape, points.ToArray());
G.DrawPolygon(DrawShape, points.ToArray());
break;
default:
throw new ArgumentOutOfRangeException(nameof(FillModes), FillMode, null);
}
break;
case ShapeTypes.Spline:
switch (FillMode)
{
case FillModes.Fill:
G.FillClosedCurve(FillShape, points.ToArray());
break;
case FillModes.Border:
G.DrawClosedCurve(DrawShape, points.ToArray());
break;
case FillModes.Both:
G.FillClosedCurve(FillShape, points.ToArray());
G.DrawClosedCurve(DrawShape, points.ToArray());
break;
default:
throw new ArgumentOutOfRangeException(nameof(FillModes), FillMode, null);
}
break;
default:
throw new ArgumentOutOfRangeException(nameof(ShapeTypes), ShapeType, null);
}
}
}