A VB2005-specific answer involves creating a class to hold the values, then populating the arraylist with instances of the class.
The class:
Public Class LookupList
Private m_Value As Integer
Private m_sDisplay As String
Public Sub New()
MyBase.New()
End Sub
Public Sub New(ByVal wValue As Integer, ByVal sDisplay As String)
Me.New()
Me.Value = wValue
Me.Display = sDisplay
End Sub
Public Property Value() As Integer
Get
Return m_Value
End Get
Set(ByVal value As Integer)
m_Value = value
End Set
End Property
Public Property Display() As String
Get
Return m_sDisplay
End Get
Set(ByVal value As String)
m_sDisplay = value
End Set
End Property
End Class
And the method:
Public Shared Function GetGenders() As ArrayList
Dim oList As New ArrayList
oList.AddRange(New LookupList() {New LookupList(1, "ap"), New LookupList(2, "up")})
Return oList
End Function
A solution that is slightly more inline with the original C# code is to create a collection class for the class:
Public Class LookupListCollection
Inherits System.Collections.Generic.List(Of LookupList)
Public Sub New()
MyBase.New()
End Sub
Public Sub New(ByVal ParamArray aItems As LookupList())
Me.New()
If aItems IsNot Nothing Then
Me.AddRange(aItems)
End If
End Sub
End Class
which can then be called as:
Public Shared Function GetGenders() As LookupListCollection
Return New LookupListCollection(New LookupList(1, "ap"), New LookupList(2, "up"))
End Function