Пример #1
0
 /// <summary>
 /// Creates a new <see cref="XEllipse"/> instance.
 /// </summary>
 /// <param name="x1">The X coordinate of <see cref="XText.TopLeft"/> corner point.</param>
 /// <param name="y1">The Y coordinate of <see cref="XText.TopLeft"/> corner point.</param>
 /// <param name="x2">The X coordinate of <see cref="XText.BottomRight"/> corner point.</param>
 /// <param name="y2">The Y coordinate of <see cref="XText.BottomRight"/> corner point.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="text">The text string.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XEllipse"/> class.</returns>
 public static XEllipse Create(double x1, double y1, double x2, double y2, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string text = null, string name = "")
 {
     return(new XEllipse()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         TopLeft = XPoint.Create(x1, y1, point),
         BottomRight = XPoint.Create(x2, y2, point),
         Text = text,
     });
 }
Пример #2
0
 /// <summary>
 /// Creates a new <see cref="XEllipse"/> instance.
 /// </summary>
 /// <param name="x">The X coordinate of <see cref="XText.TopLeft"/> and <see cref="XText.BottomRight"/> corner points.</param>
 /// <param name="y">The Y coordinate of <see cref="XText.TopLeft"/> and <see cref="XText.BottomRight"/> corner points.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="text">The text string.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XEllipse"/> class.</returns>
 public static XEllipse Create(double x, double y, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string text = null, string name = "")
 {
     return(Create(x, y, x, y, style, point, isStroked, isFilled, text, name));
 }
Пример #3
0
 /// <summary>
 /// Creates a new <see cref="XCubicBezier"/> instance.
 /// </summary>
 /// <param name="point1">The <see cref="XCubicBezier.Point1"/> point.</param>
 /// <param name="point2">The <see cref="XCubicBezier.Point2"/> point.</param>
 /// <param name="point3">The <see cref="XCubicBezier.Point3"/> point.</param>
 /// <param name="point4">The <see cref="XCubicBezier.Point4"/> point.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XCubicBezier"/> class.</returns>
 public static XCubicBezier Create(XPoint point1, XPoint point2, XPoint point3, XPoint point4, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string name = "")
 {
     return(new XCubicBezier()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         Point1 = point1,
         Point2 = point2,
         Point3 = point3,
         Point4 = point4
     });
 }
Пример #4
0
 public static PointShape FromPoint2(this Point2 point, BaseShape template = null)
 {
     return(new PointShape(point.X, point.Y, template));
 }
Пример #5
0
 /// <summary>
 /// Creates a new <see cref="XCubicBezier"/> instance.
 /// </summary>
 /// <param name="x1">The X coordinate of <see cref="XCubicBezier.Point1"/> point.</param>
 /// <param name="y1">The Y coordinate of <see cref="XCubicBezier.Point1"/> point.</param>
 /// <param name="x2">The X coordinate of <see cref="XCubicBezier.Point2"/> point.</param>
 /// <param name="y2">The Y coordinate of <see cref="XCubicBezier.Point2"/> point.</param>
 /// <param name="x3">The X coordinate of <see cref="XCubicBezier.Point3"/> point.</param>
 /// <param name="y3">The Y coordinate of <see cref="XCubicBezier.Point3"/> point.</param>
 /// <param name="x4">The X coordinate of <see cref="XCubicBezier.Point4"/> point.</param>
 /// <param name="y4">The Y coordinate of <see cref="XCubicBezier.Point4"/> point.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XCubicBezier"/> class.</returns>
 public static XCubicBezier Create(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string name = "")
 {
     return(new XCubicBezier()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         Point1 = XPoint.Create(x1, y1, point),
         Point2 = XPoint.Create(x2, y2, point),
         Point3 = XPoint.Create(x3, y3, point),
         Point4 = XPoint.Create(x4, y4, point)
     });
 }
Пример #6
0
 /// <summary>
 /// Creates a new <see cref="XCubicBezier"/> instance.
 /// </summary>
 /// <param name="x">The X coordinate of <see cref="XCubicBezier.Point1"/>, <see cref="XCubicBezier.Point2"/>, <see cref="XCubicBezier.Point3"/> and <see cref="XCubicBezier.Point4"/> points.</param>
 /// <param name="y">The Y coordinate of <see cref="XCubicBezier.Point1"/>, <see cref="XCubicBezier.Point2"/>, <see cref="XCubicBezier.Point3"/> and <see cref="XCubicBezier.Point4"/> points.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XCubicBezier"/> class.</returns>
 public static XCubicBezier Create(double x, double y, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string name = "")
 {
     return(Create(x, y, x, y, x, y, x, y, style, point, isStroked, isFilled, name));
 }
Пример #7
0
 /// <summary>
 /// Creates a new <see cref="XImage"/> instance.
 /// </summary>
 /// <param name="topLeft">The <see cref="XText.TopLeft"/> corner point.</param>
 /// <param name="bottomRight">The <see cref="XText.BottomRight"/> corner point.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="key">The image key.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="text">The text string.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XImage"/> class.</returns>
 public static XImage Create(XPoint topLeft, XPoint bottomRight, ShapeStyle style, BaseShape point, string key, bool isStroked = false, bool isFilled = false, string text = null, string name = "")
 {
     return(new XImage()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         TopLeft = topLeft,
         BottomRight = bottomRight,
         Key = key,
         Text = text
     });
 }
Пример #8
0
 /// <summary>
 /// Creates a new <see cref="XRectangle"/> instance.
 /// </summary>
 /// <param name="x1">The X coordinate of <see cref="XText.TopLeft"/> corner point.</param>
 /// <param name="y1">The Y coordinate of <see cref="XText.TopLeft"/> corner point.</param>
 /// <param name="x2">The X coordinate of <see cref="XText.BottomRight"/> corner point.</param>
 /// <param name="y2">The Y coordinate of <see cref="XText.BottomRight"/> corner point.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="text">The text string.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XRectangle"/> class.</returns>
 public static XRectangle Create(double x1, double y1, double x2, double y2, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string text = null, string name = "")
 {
     return(new XRectangle()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         TopLeft = XPoint.Create(x1, y1, point),
         BottomRight = XPoint.Create(x2, y2, point),
         Text = text,
         IsGrid = false,
         OffsetX = 30.0,
         OffsetY = 30.0,
         CellWidth = 30.0,
         CellHeight = 30.0
     });
 }
Пример #9
0
 /// <summary>
 /// Creates a new <see cref="XRectangle"/> instance.
 /// </summary>
 /// <param name="topLeft">The <see cref="XText.TopLeft"/> corner point.</param>
 /// <param name="bottomRight">The <see cref="XText.BottomRight"/> corner point.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="text">The text string.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="XRectangle"/> class.</returns>
 public static XRectangle Create(XPoint topLeft, XPoint bottomRight, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string text = null, string name = "")
 {
     return(new XRectangle()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         TopLeft = topLeft,
         BottomRight = bottomRight,
         Text = text,
         IsGrid = false,
         OffsetX = 30.0,
         OffsetY = 30.0,
         CellWidth = 30.0,
         CellHeight = 30.0
     });
 }
Пример #10
0
 /// <summary>
 /// Creates a new <see cref="EllipseShape"/> instance.
 /// </summary>
 /// <param name="topLeft">The <see cref="TextShape.TopLeft"/> corner point.</param>
 /// <param name="bottomRight">The <see cref="TextShape.BottomRight"/> corner point.</param>
 /// <param name="style">The shape style.</param>
 /// <param name="point">The point template.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isFilled">The flag indicating whether shape is filled.</param>
 /// <param name="text">The text string.</param>
 /// <param name="name">The shape name.</param>
 /// <returns>The new instance of the <see cref="EllipseShape"/> class.</returns>
 public static EllipseShape Create(PointShape topLeft, PointShape bottomRight, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string text = null, string name = "")
 {
     return(new EllipseShape()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         TopLeft = topLeft,
         BottomRight = bottomRight,
         Text = text,
     });
 }
Пример #11
0
 /// <summary>
 /// Adds <see cref="BaseShape"/> to <see cref="Shapes"/> collection.
 /// </summary>
 /// <param name="shape">The shape object.</param>
 public void AddShape(BaseShape shape)
 {
     shape.Owner        = this;
     shape.State.Flags &= ~ShapeStateFlags.Standalone;
     Shapes             = Shapes.Add(shape);
 }