I would like to create a class that would would have 2 properties a name (as type string) and a type (as any type). The idea is I could create a collection of my class so I could pass my collection of parameters
Public Class parameter
Dim m_ParameterName As String
Dim m_ParameterType As Type
Public Property ParameterName As String
Get
Return m_ParameterName
End Get
Set(ByVal value As String)
m_ParameterName = value
End Set
End Property
Public Property ParameterType() As T
Get
Return m_ParameterType
End Get
Set(ByVal value As T)
m_ParameterType = value
End Set
End Property
Sub New()
m_ParameterType = Nothing
m_ParameterName = ""
End Sub
End Class
Then I would like to create an instance of the class and define the properties as so
Dim myParameter As New parameter
myParameter.ParameterName = "Name"
myParameter.ParameterType = String
or
Dim myParameter As New parameter
myParameter.ParameterName = "Name"
myParameter.ParameterType = integer
or
Dim myParameter As New parameter
myParameter.ParameterName = "Name"
myParameter.ParameterType = clsCustomClass
Is this possible?
Just leave the type blank – that is like “var” in c#
another option would be use
As Object