This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Custom PolylineVObject and custom PolylineVObject designer

Hi,

I need implement cutom PolylineVObject and designer. I'm found solution,
but for me missing information how to set array of points from custom PolylineVObject designer.
Please help me with this question,

Thank you

Roman

Imports Aurigma.GraphicsMill.WinControls

Public Class TypA
Inherits Aurigma.GraphicsMill.WinControls.PolylineVObject

Public Sub New(ByVal pt() As PointF)
MyBase.New(pt, True, Drawing2D.FillMode.Alternate)
MyBase.Pen = New System.Drawing.Pen(Color.Cyan, 1)
MyBase.Brush = New SolidBrush(Color.FromArgb(120, Color.Cyan))
MyBase.Tag = "TypA"
End Sub

Public Overrides Sub Draw(renderingRect As System.Drawing.Rectangle, g As System.Drawing.Graphics, coordinateMapper As Aurigma.GraphicsMill.WinControls.ICoordinateMapper)
MyBase.Draw(renderingRect, g, coordinateMapper)
End Sub

End Class


Public Class TypADesigner
Implements Aurigma.GraphicsMill.WinControls.IDesigner

Public Sub New()
_vObjectHost = Nothing
_objects = New TypA() {}
End Sub

Public Sub Draw(ByVal g As System.Drawing.Graphics) Implements Aurigma.GraphicsMill.WinControls.IDesigner.Draw
End Sub

Public ReadOnly Property Connected() As Boolean Implements Aurigma.GraphicsMill.WinControls.IDesigner.Connected
Get
Return Not IsNothing(_vObjectHost)
End Get
End Property

Public ReadOnly Property VObjects() As Aurigma.GraphicsMill.WinControls.IVObject() Implements Aurigma.GraphicsMill.WinControls.IDesigner.VObjects
Get
Return _objects
End Get
End Property

Public Sub NotifyConnect(ByVal vObjectHost As Aurigma.GraphicsMill.WinControls.IVObjectHost) Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyConnect
_vObjectHost = vObjectHost
End Sub

Public Sub NotifyDisconnect() Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyDisconnect
_vObjectHost = Nothing
End Sub

Public Function NotifyKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs) As Boolean Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyKeyDown
Return True
End Function

Public Function NotifyKeyUp(ByVal e As System.Windows.Forms.KeyEventArgs) As Boolean Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyKeyUp
Return True
End Function

Public Function NotifyMouseDoubleClick(ByVal e As System.EventArgs) As Boolean Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyMouseDoubleClick
Return True
End Function

Public Function NotifyMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs) As Boolean Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyMouseDown
Dim obj As New TypA(New PointF() {})
_vObjectHost.CurrentLayer.VObjects.Insert(0, obj)
_vObjectHost.CurrentDesigner = _vObjectHost.DefaultDesigner
End Function

Public Function NotifyMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs) As Boolean Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyMouseMove
Return True
End Function

Public Function NotifyMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs) As Boolean Implements Aurigma.GraphicsMill.WinControls.IDesigner.NotifyMouseUp
Return True
End Function

Public Sub UpdateSettings() Implements Aurigma.GraphicsMill.WinControls.IDesigner.UpdateSettings
End Sub

Public _objects() As TypA
Private _vObjectHost As Aurigma.GraphicsMill.WinControls.IVObjectHost

End Class
Hello Roman,

Please submit new support ticket, and describe your problem in details. Unfortunately, we do not understand what you want to get using this code.