Monday, 19 August 2013

Property for Array to be used inside List

Property for Array to be used inside List

I have a Class ABC. And i want to write two properties for it. One i have
already mentioned in the code. The other one will be a single dimensional
array.
Public Class ABC
Private m_Type As String
Private SomeArray........need to write a property for array which will
be of type `int`
Public Property Type() As String
Get
Return m_Type
End Get
Set(ByVal value As String)
m_Type = value
End Set
End Property
End Class
I am not sure how to define a property for array which can be used in a
List(Of ABC). The property for array can be a read only array as i will be
hard coding the data for it.
So basically when i do this,
Dim SomeList As New List(Of ABC)
And inside a for loop i need something like this,
SomeList.Item(index).SomeArray......this will give me all the items inside
the array

No comments:

Post a Comment