This commit is contained in:
2021-03-17 10:24:34 +01:00
parent 45696f2d19
commit 6871d6952f
3 changed files with 29 additions and 3 deletions

View File

@@ -2,6 +2,12 @@
Public Class PluginManager Public Class PluginManager
''' <summary>
''' Gets or sets an indicator if an exception should throw on error while loading a plugin.
''' </summary>
''' <returns></returns>
Public Property ThrowOnError As Boolean = False
''' <summary> ''' <summary>
''' The name of the type where to search for Methods when loading a new Plugin. ''' The name of the type where to search for Methods when loading a new Plugin.
''' </summary> ''' </summary>
@@ -79,7 +85,11 @@ Public Class PluginManager
If addToList Then Plugins.Add(filePath, plugin) If addToList Then Plugins.Add(filePath, plugin)
Return plugin Return plugin
Catch ex As Exception Catch ex As Exception
If ThrowOnError Then
Throw
Else
Return Nothing Return Nothing
End If
End Try End Try
End Function End Function

View File

@@ -314,7 +314,7 @@ Public Class PaintingControl
Private Sub SaveObjectPositions(e As MouseEventArgs, objs As IList) Private Sub SaveObjectPositions(e As MouseEventArgs, objs As IList)
For Each obj As PaintingObject In objs For Each obj As PaintingObject In objs
If Not savedPos.ContainsKey(obj) Then If Not obj.HardcodedLocation AndAlso Not savedPos.ContainsKey(obj) Then
savedPos.Add(obj, New PointF(e.X - obj.Location.X + Offset.X, e.Y - obj.Location.Y + Offset.Y)) savedPos.Add(obj, New PointF(e.X - obj.Location.X + Offset.X, e.Y - obj.Location.Y + Offset.Y))
SaveObjectPositions(e, obj.PinnedObjects) SaveObjectPositions(e, obj.PinnedObjects)
End If End If

View File

@@ -42,7 +42,8 @@ Imports Newtonsoft.Json
<JsonIgnore> Public Property BufferedImage As Image = Nothing <JsonIgnore> Public Property BufferedImage As Image = Nothing
Public Property ImageSizeMode As ImageSizeMode Public Property ImageSizeMode As ImageSizeMode
Public Property ImageProperties As New PaintingObjectImageProperties Public Property ImageProperties As New PaintingObjectImageProperties
Public Property Tag As String = Nothing <JsonIgnore>
Public Property Tag As Object = Nothing
Public Property Name As String = "" Public Property Name As String = ""
Public ReadOnly Property PinnedObjects As New List(Of PaintingObject) Public ReadOnly Property PinnedObjects As New List(Of PaintingObject)
<JsonIgnore> <JsonIgnore>
@@ -51,6 +52,7 @@ Imports Newtonsoft.Json
Public ReadOnly Property DrawSelectionMethode As DelegateDrawPaintingObjectMethode = AddressOf DefaultDrawMethodes.DrawSelection Public ReadOnly Property DrawSelectionMethode As DelegateDrawPaintingObjectMethode = AddressOf DefaultDrawMethodes.DrawSelection
Public Property Cursor As Cursor = Cursors.Default Public Property Cursor As Cursor = Cursors.Default
Public Property HardcodedSize As Boolean = False Public Property HardcodedSize As Boolean = False
Public Property HardcodedLocation As Boolean = False
<JsonProperty> <JsonProperty>
Private _Visible As Boolean = True Private _Visible As Boolean = True
<JsonProperty> <JsonProperty>
@@ -421,6 +423,20 @@ Imports Newtonsoft.Json
End Set End Set
End Property End Property
<JsonProperty(NameOf(Tag))>
Public Property TagString As String
Get
If TypeOf Tag Is String Then
Return Tag
Else
Return String.Empty
End If
End Get
Set(value As String)
Tag = value
End Set
End Property
Public Property EnableResize As Boolean Public Property EnableResize As Boolean
Get Get
If resizeEngine Is Nothing Then If resizeEngine Is Nothing Then