G
Guest
Hello
I run into problems on how to create array instances. I'm playing around for
hours now and can't find a solution for this. How can I assign an instance of
the Mysegment class to the rendition segments property?
Any help is greatly appreciated.
Thanks
magriii
Public Class Form1
Partial Public Class Segment
Private segmentNumberField As Integer
Private nameField As String
Public Property SegmentNumber() As Integer
Get
Return Me.segmentNumberField
End Get
Set(ByVal value As Integer)
Me.segmentNumberField = value
End Set
End Property
Public Property Title() As String
Get
Return Me.nameField
End Get
Set(ByVal value As String)
Me.nameField = value
End Set
End Property
End Class
Partial Public Class Segments
Private segmentField() As Segment
Public Property Segment() As Segment()
Get
Return Me.segmentField
End Get
Set(ByVal value As Segment())
Me.segmentField = value
End Set
End Property
End Class
Partial Public Class Rendition
Private idField As String
Private segmentsField As Segments
Public Property ID() As String
Get
Return Me.idField
End Get
Set(ByVal value As String)
Me.idField = value
End Set
End Property
Public Property Segments() As Segments
Get
Return Me.segmentsField
End Get
Set(ByVal value As Segments)
Me.segmentsField = value
End Set
End Property
End Class
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim MyRendition As Rendition = New Rendition
Dim mysegments() As Segments = New Segments() {}
Dim MySegment As Segment = New Segment
MySegment.SegmentNumber = 1
MySegment.Title = "test"
MyRendition.ID = "123"
'''PROBLEM starts here
MyRendition.Segments(0).Segment(0) = MySegment
End Sub
End Class
I run into problems on how to create array instances. I'm playing around for
hours now and can't find a solution for this. How can I assign an instance of
the Mysegment class to the rendition segments property?
Any help is greatly appreciated.
Thanks
magriii
Public Class Form1
Partial Public Class Segment
Private segmentNumberField As Integer
Private nameField As String
Public Property SegmentNumber() As Integer
Get
Return Me.segmentNumberField
End Get
Set(ByVal value As Integer)
Me.segmentNumberField = value
End Set
End Property
Public Property Title() As String
Get
Return Me.nameField
End Get
Set(ByVal value As String)
Me.nameField = value
End Set
End Property
End Class
Partial Public Class Segments
Private segmentField() As Segment
Public Property Segment() As Segment()
Get
Return Me.segmentField
End Get
Set(ByVal value As Segment())
Me.segmentField = value
End Set
End Property
End Class
Partial Public Class Rendition
Private idField As String
Private segmentsField As Segments
Public Property ID() As String
Get
Return Me.idField
End Get
Set(ByVal value As String)
Me.idField = value
End Set
End Property
Public Property Segments() As Segments
Get
Return Me.segmentsField
End Get
Set(ByVal value As Segments)
Me.segmentsField = value
End Set
End Property
End Class
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim MyRendition As Rendition = New Rendition
Dim mysegments() As Segments = New Segments() {}
Dim MySegment As Segment = New Segment
MySegment.SegmentNumber = 1
MySegment.Title = "test"
MyRendition.ID = "123"
'''PROBLEM starts here
MyRendition.Segments(0).Segment(0) = MySegment
End Sub
End Class