/// <summary>
 /// Adds a polygon to this path.
 /// </summary>
 public void AddPolygon(XPoint[] points)
 {
   this.items.Add(new XGraphicsPathItem(XGraphicsPathItemType.Polygon, points.Clone() as XPoint[]));
   this.dirty = true;
   this.gdipPath.AddPolygon(XGraphics.MakePointFArray(points));
 }
    /// <summary>
    /// Adds a sequence of connected cubic Bézier curves to the current figure.
    /// </summary>
    public void AddBeziers(XPoint[] points)
    {
      if (points.Length < 4)
        throw new ArgumentException("At least four points required for bezier curve.", "points");

      if ((points.Length - 1) % 3 != 0)
        throw new ArgumentException("Invalid number of points for bezier curve. Number must fulfil 4+3n.", "points");

      this.items.Add(new XGraphicsPathItem(XGraphicsPathItemType.Beziers, points.Clone() as XPoint[]));
      this.dirty = true;
      this.gdipPath.AddBeziers(XGraphics.MakePointFArray(points));
    }