I have a property which is an array of items but when I come to add an item to the array it says I must use the new keyword, but I can't use a new keyboard with a property.
(item is a custom class)
Private itemsvalue As item()
Public Property Items() As item()
Get
Return itemsvalue
End Get
Set(ByVal value As DBPFindexitem())
itemsvalue = value
End Set
End Property
Sub New(ByVal indexbytes As Byte(), ByVal number as integer)
For count As Integer = 0 To number
Dim offset As Integer = count * 2 * 4
Dim xx As New item
xx.Group = BitConverter.ToInt32(indexbytes, offset + 0)
xx.ID = BitConverter.ToInt32(indexbytes, offset + 8)
Items(count) = xx
Next
End Sub
I have no idea how I can add the xx
item to the array of items.