using System; using global::System.Drawing; namespace Pilz.UI { public class PaintingObjectPaintEventArgs : EventArgs { /// /// The Painting Object to draw. /// /// public PaintingObject PaintingObject { get; private set; } /// /// The current offset of the page on the screen. /// /// public PointF Offset { get; private set; } /// /// The Grpahics from the parent PaintingControl. /// /// public Graphics Graphics { get; private set; } /// /// The position of the PaintingObject on Screen. /// /// public PointF Location { get { return new PointF(X, Y); } } /// /// The X position of the PaintingObject on Screen. /// /// public float X { get { return PaintingObject.X - Offset.X; } } /// /// The Y position of the PaintingObject on Screen. /// /// public float Y { get { return PaintingObject.Y - Offset.Y; } } /// /// The rectangle of the PaintingObject on Screen. /// /// public RectangleF Rectangle { get { return new RectangleF(X, Y, PaintingObject.Width, PaintingObject.Height); } } internal PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g) : this(obj, g, obj.Parent.Offset) { } internal PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g, PointF offset) { PaintingObject = obj; Offset = offset; Graphics = g; } } }