Tech Off Post

Single Post Permalink

View Thread: Class Design
  • User profile image
    VBJB

    Sven Groot wrote:

    Alarm.vb:

    Public Class Alarm
       Private mAlarmMessage As String

       Public Sub New(ByVal alarmMessage As String)
          mAlarmMessage = alarmMessage
       End Sub

       Public ReadOnly Property AlarmMessage() As String
          Get
             Return mAlarmMessage
          End Get
       End Property
    End Class
     


    FMA3.vb

    Public Class FMA3
       Private mAlarm As Alarm

       Public Sub New()
          mAlarm = New Alarm("This is the alarm message")
       End Sub

       Public ReadOnly Property Alarm() As Alarm
          Get
             Return mAlarm
          End Get
       End Property
    End Class
     



    Using this example I am still not 100% there or am I not reading it right. My properties are still going to read FMA3.AlarmMsg or FMA3.AlarmNum not FMA3.Alarm.Msg or FMA3.Alarm.Number.