Im not sure is a nested class is the right way to do this.
I am trying to build a class that can store multiple alarm ID's and for each ID have several other settings.
This will then be used to raise an event in another part of the program and pass the other settings with the event.
The structure I am trying to create would be like this.
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'AlarmID
' MonitorID
' SalvoID
' LoopReplay
' Time
' Camera
' Position
' LiveCamera
' Add
' MatrixID
' Position
' Read
' MatrixID
' Position
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
To create a new Alarm Source, I want to be able to do the following
AlarmID.Add=20
AlarmID(20).MonitorID=1
AlarmID(20).LiveCamera.Add(Matrix,Monitor)
Then be able to read each part back based on the AlarmID
I have been experimenting with nested Classes as follows but just cant work it out!
Class AlarmID
Public LiveCameras() As LiveCamera
Private m_Items(0) As Integer
Default Public ReadOnly Property Item(ByVal AlarmID As Integer) As Integer
Get
Item = m_Items(AlarmID)
End Get
End Property
Private m_Count As Integer
Public ReadOnly Property Count() As Integer
Get
Count = m_Count
End Get
End Property
Public Sub Add(ByVal AlarmID As Integer)
ReDim Preserve m_Items(Count)
m_Items(Count) = AlarmID
m_Count += 1
End Sub
Class LiveCamera
Private m_Items(1, 0) As Integer
Default Public ReadOnly Property Item(ByVal MatrixID As Integer, ByVal WindowID As Integer) As Integer
Get ' (1)
Item = m_Items(MatrixID, WindowID)
End Get
End Property
Private m_Count As Integer
Public ReadOnly Property Count() As Integer
Get
Count = m_Count
End Get
End Property
Public Sub Add(ByVal MatrixID As Integer, ByVal WindowID As Integer)
ReDim Preserve m_Items(1, Count)
m_Items(0, Count) = MatrixID
m_Items(1, Count) = WindowID
m_Count += 1
End Sub
End Class
End Class