how get the custom properties of a custom class in vb.net

I made this class
<Serializable()> _
Public Class mystep3
    Inherits NStep3Connector
    Implements ISerializable

#Region "Serialization"
    Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
        e_MiID = info.GetString("MiID")
    End Sub

    Public Sub GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) Implements System.Runtime.Serialization.ISerializable.GetObjectData
        info.AddValue("MiID", e_MiID)
    End Sub
#End Region

#Region " properties ..."
    Public e_MiID As String = Nothing
    <Browsable(True)> _
    Public Property MiID() As String
        Get
            Return e_MiID
        End Get
        Set(ByVal value As String)
            e_MiID = value
        End Set
    End Property
#End Region

#Region "Initializers"
    Public Sub New()
        MyBase.New(False)
        MyBase.StyleSheetName = NDR.NameConnectorsStyleSheet
        MyBase.StartPoint = New NPointF(250, 220)
        MyBase.EndPoint = New NPointF(330, 280)
        MyBase.FirstVertical = True
    End Sub
#End Region
End Class

Open in new window


It works ok, but I have this issue:

Im trying to access the custom property "MiID" by code but I cannot find it, if try to listen the properties I only find it following this steps:
step1: example0.jpg
step2:
example.jpg

Is ther a way to assigned it to a variable ???

Do Im doing something wrong??????
altariamx2003Asked:
Who is Participating?
 
Michael FowlerSolutions ConsultantCommented:
Not sure what you are trying to do. MiID appears in the class list but you will not see a Get and Set methods as these are behind the scenes. You just reference the property using standard "dot" notation eg

Dim ms3 as mystep3 = new mystep3()
ms3.MiID = "Hello World"
MessageBox.Show(ms3.MiID)

Open in new window

0
 
Jacques Bourgeois (James Burger)PresidentCommented:
First of all, e_MiID should be Private. Making it Public makes it available to any user of your class, which completely defeats the reasons behind a property.

Then, in your test, the break is on the wrong line. You are breaking on the If itself. it has not been executed. So it is quite possible that nodo is not of type mystep3, and thus does not have your added property..

I would go one line further (F10) before consulting the debugger. You might well end up on the End If instead of inside the If, which would indicate that nodo was not instantiated as you intended it to be.
0
 
altariamx2003Author Commented:
Thia is the solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.