Link to home
Start Free TrialLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

System.StackOverflowException when a I use a custom class

Im doing a system that draw customized diagrams


Im trying to implement this code
Imports System
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Drawing
Imports Nevron.Diagram
Imports Nevron.GraphicsCore
Imports Nevron.Dom
<Serializable()> _
Public Class tanques
    Inherits NRectangleShape
#Region " properties ..."
    Private e_conectado As String
    Public Property conectado() As String
        Get
            Return e_conectado
        End Get
        Set(ByVal value As String)
            e_conectado = value
        End Set
    End Property
#End Region

    Public Sub New(ByVal a As Single, ByVal b As Single, ByVal c As Single, ByVal d As Single)
        MyBase.New(a, b, c, d)
    End Sub
End Class

Open in new window

to use a customized shape when I add a new node

After I add the new node to the workspace everything looks fine but when I try to move the node with the mouse visual basic show the following error: "exception System.StackOverflowException on mscorlib.dll

I would like to know what is happend???

My custom form is ok???

Do I need to add another thing???

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of altariamx2003

ASKER

I dont have the code, this is what i got using .net reflector

 
NRECTANGLESHAPE
<Serializable> _
Public Class NRectangleShape
    Inherits NPathShape
    ' Methods
    <EditorBrowsable(EditorBrowsableState.Never)> _
    Public Sub New()
    Public Sub New(ByVal primitive As NRectanglePath)
    Public Sub New(ByVal rect As NRectangleF)
    Public Sub New(ByVal corners As NPointF())
    Public Sub New(ByVal leftTop As NPointF, ByVal rightBottom As NPointF)
    Public Sub New(ByVal location As NPointF, ByVal size As NSizeF)
    Public Sub New(ByVal corner1 As NPointF, ByVal corner2 As NPointF, ByVal corner3 As NPointF, ByVal corner4 As NPointF)
    Public Sub New(ByVal x As Single, ByVal y As Single, ByVal width As Single, ByVal height As Single)
    Protected Overrides Sub CreateDefaultLabels()
End Class


NPATHSHAPE
<Serializable, XmlInclude(GetType(NPolyPathShape)), XmlInclude(GetType(NArrowShape)), XmlInclude(GetType(NLineShape)), XmlInclude(GetType(NRectangleShape)), XmlInclude(GetType(NEllipseShape)), XmlInclude(GetType(NEllipticalArcShape)), XmlInclude(GetType(NCircularArcShape)), XmlInclude(GetType(NBezierCurveShape)), XmlInclude(GetType(NStepConnector))> _
Public MustInherit Class NPathShape
    Inherits NPrimitiveShape
    Implements INPoints, INDiagramElement, INElement, INNode, INIdentifiable, INUniquelyIdentifiable, INAttributeContainer, INAttributeObserver, ICloneable
    ' Methods
    Public Sub New(ByVal primitive As NPathPrimitive)
    Protected Overrides Function GetDefaultShapeElements() As ShapeElementsMask
    Public Overridable Function GetPointAt(ByVal index As Integer) As NPointF
    Public Overridable Function GetPointInfo(ByVal index As Integer) As NPointInfo
    Public Overridable Sub SetPointAt(ByVal index As Integer, ByVal point As NPointF)

    ' Properties
    <Category("Scene"), Description("Gets/sets the shape points"), XmlIgnore> _
    Public Overridable Property Points As NPointF()
    <Browsable(False)> _
    Public Overridable ReadOnly Property PointsCount As Integer
End Class

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I know that there is a big problem, nrectangleshape is provided by the libraries of nevron

I know that you need the souce code, but right know its impossible to me

thx anyway for your time