better json serializable PaintingObjects
This commit is contained in:
@@ -19,18 +19,22 @@ Imports Newtonsoft.Json
|
||||
Public Property OutlineColor As Color = Color.DarkBlue
|
||||
Public Property OutlineThicknes As Single = 1
|
||||
Public Property OutlineDashStyle As DashStyle = DashStyle.Solid
|
||||
<JsonProperty>
|
||||
Private _Text As String = ""
|
||||
Public Property TextPosition As TextPosition = TextPosition.FullCenter
|
||||
Public Property VerticalTextAlignment As StringAlignment = StringAlignment.Center
|
||||
Public Property HorizontalTextAlignment As StringAlignment = StringAlignment.Center
|
||||
Public Property TextFont As New Font(FontFamily.GenericSansSerif, 8.25)
|
||||
Public Property TextColor As Color = Color.Black
|
||||
<JsonProperty>
|
||||
Private _Location As New PointF(50, 50)
|
||||
<JsonProperty>
|
||||
Private _Size As New SizeF(50, 80)
|
||||
Public Property EnableFill As Boolean = True
|
||||
Public Property EnableOutline As Boolean = True
|
||||
Public Property SelectionColor As Color = Color.CornflowerBlue
|
||||
Public Property SelectionDashStyle As DashStyle = DashStyle.Dot
|
||||
<JsonProperty>
|
||||
Private _EnableSelection As Boolean = True
|
||||
Public Property Image As Image = Nothing
|
||||
<JsonIgnore> Public Property BufferedImage As Image = Nothing
|
||||
@@ -39,15 +43,20 @@ Imports Newtonsoft.Json
|
||||
Public Property Tag As String = Nothing
|
||||
Public Property Name As String = ""
|
||||
Public ReadOnly Property PinnedObjects As New List(Of PaintingObject)
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property DrawMethodes As New List(Of DelegateDrawPaintingObjectMethode)
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property DrawSelectionMethode As DelegateDrawPaintingObjectMethode = AddressOf DefaultDrawMethodes.DrawSelection
|
||||
Public Property Cursor As Cursor = Cursors.Default
|
||||
Public Property HardcodedSize As Boolean = False
|
||||
<JsonProperty>
|
||||
Private _Visible As Boolean = True
|
||||
<JsonProperty>
|
||||
Private _AutoAlignToGrid As Boolean = False
|
||||
Public Property MouseTransparency As Boolean = False
|
||||
Public ReadOnly Property Layering As New PaintingObjectLayering(Me)
|
||||
Public ReadOnly Property PaintingObjects As New PaintingObjectList(_Parent) With {.EnableRaisingEvents = False}
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property ErrorsAtDrawing As ULong = 0
|
||||
|
||||
Public Event MouseClick(sender As PaintingObject, e As MouseEventArgs)
|
||||
@@ -321,6 +330,7 @@ Imports Newtonsoft.Json
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<JsonIgnore>
|
||||
Public Property Rectangle As RectangleF
|
||||
Get
|
||||
Return New RectangleF(Location, Size)
|
||||
@@ -528,8 +538,10 @@ End Class
|
||||
Public Class PaintingObjectList
|
||||
Inherits List(Of PaintingObject)
|
||||
|
||||
<JsonIgnore>
|
||||
Friend ReadOnly Property MyParent As PaintingControl
|
||||
Friend Property EnableRaisingEvents As Boolean = True
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property Layering As New PaintingObjectListLayering(Me)
|
||||
|
||||
Public Sub New()
|
||||
|
||||
3
Pilz.UI/PaintingControl/PaintingObjectJsonSerializer.vb
Normal file
3
Pilz.UI/PaintingControl/PaintingObjectJsonSerializer.vb
Normal file
@@ -0,0 +1,3 @@
|
||||
Public Class PaintingObjectJsonSerializer
|
||||
|
||||
End Class
|
||||
@@ -1,11 +1,22 @@
|
||||
Public Class PaintingObjectLayering
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Public Class PaintingObjectLayering
|
||||
|
||||
<JsonProperty(NameOf(PaintingObject))>
|
||||
Private ReadOnly _PaintingObject As PaintingObject
|
||||
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property PaintingObject As PaintingObject
|
||||
Get
|
||||
Return _PaintingObject
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Get the current object list from the painting object.
|
||||
''' </summary>
|
||||
''' <returns>Returns the current object list from the painting object.</returns>
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property ObjectList As PaintingObjectList
|
||||
Get
|
||||
Return PaintingObject.Parent.PaintingObjects
|
||||
@@ -17,7 +28,7 @@
|
||||
''' </summary>
|
||||
''' <param name="obj"></param>
|
||||
Public Sub New(obj As PaintingObject)
|
||||
PaintingObject = obj
|
||||
_PaintingObject = obj
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
|
||||
Reference in New Issue
Block a user