change UI to UI.WinForms
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace Pilz.UI.WinForms.PaintingControl.EventArgs;
|
||||
|
||||
public class PaintingObjectEventArgs(PaintingObject[] paintingObjects) : EventArgs
|
||||
{
|
||||
public PaintingObject[] PaintingObjects { get; private set; } = paintingObjects;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
' Nicht gemergte Änderung aus Projekt "Pilz.UI (net8.0-windows)"
|
||||
' Vor:
|
||||
' Imports System.Windows.Forms
|
||||
' Imports Newtonsoft.Json
|
||||
' Nach:
|
||||
' Imports System.Windows.Forms
|
||||
'
|
||||
' Imports Newtonsoft.Json
|
||||
Public Class PaintingObjectEventArgs
|
||||
Inherits EventArgs
|
||||
|
||||
Public ReadOnly Property PaintingObjects As PaintingObject() = Nothing
|
||||
|
||||
Friend Sub New(paintingObjects As PaintingObject())
|
||||
_PaintingObjects = paintingObjects
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Pilz.UI.WinForms.PaintingControl.EventArgs;
|
||||
|
||||
public class PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g, PointF offset) : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The Painting Object to draw.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PaintingObject PaintingObject { get; } = obj;
|
||||
|
||||
/// <summary>
|
||||
/// The current offset of the page on the screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PointF Offset { get; } = offset;
|
||||
|
||||
/// <summary>
|
||||
/// The Grpahics from the parent PaintingControl.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Graphics Graphics { get; } = g;
|
||||
|
||||
/// <summary>
|
||||
/// The position of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PointF Location => new(X, Y);
|
||||
|
||||
/// <summary>
|
||||
/// The X position of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public float X => PaintingObject.X - Offset.X;
|
||||
|
||||
/// <summary>
|
||||
/// The Y position of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public float Y => PaintingObject.Y - Offset.Y;
|
||||
|
||||
/// <summary>
|
||||
/// The rectangle of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public RectangleF Rectangle => new RectangleF(X, Y, PaintingObject.Width, PaintingObject.Height);
|
||||
|
||||
public PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g) : this(obj, g, obj.Parent.Offset)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
Imports System.Drawing
|
||||
' Nicht gemergte Änderung aus Projekt "Pilz.UI (net8.0-windows)"
|
||||
' Vor:
|
||||
' Imports System.Windows.Forms
|
||||
' Imports Newtonsoft.Json
|
||||
' Nach:
|
||||
' Imports System.Windows.Forms
|
||||
'
|
||||
' Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Public Class PaintingObjectPaintEventArgs
|
||||
Inherits EventArgs
|
||||
|
||||
''' <summary>
|
||||
''' The Painting Object to draw.
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property PaintingObject As PaintingObject
|
||||
|
||||
''' <summary>
|
||||
''' The current offset of the page on the screen.
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property Offset As PointF
|
||||
|
||||
''' <summary>
|
||||
''' The Grpahics from the parent PaintingControl.
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property Graphics As Graphics
|
||||
|
||||
''' <summary>
|
||||
''' The position of the PaintingObject on Screen.
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property Location As PointF
|
||||
Get
|
||||
Return New PointF(X, Y)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' The X position of the PaintingObject on Screen.
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property X As Single
|
||||
Get
|
||||
Return PaintingObject.X - Offset.X
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' The Y position of the PaintingObject on Screen.
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property Y As Single
|
||||
Get
|
||||
Return PaintingObject.Y - Offset.Y
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' The rectangle of the PaintingObject on Screen.
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property Rectangle As RectangleF
|
||||
Get
|
||||
Return New RectangleF(X, Y, PaintingObject.Width, PaintingObject.Height)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub New(obj As PaintingObject, g As Graphics)
|
||||
Me.New(obj, g, obj.Parent.Offset)
|
||||
End Sub
|
||||
|
||||
Friend Sub New(obj As PaintingObject, g As Graphics, offset As PointF)
|
||||
PaintingObject = obj
|
||||
Me.Offset = offset
|
||||
Graphics = g
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user