J
Jeff Bunting
Given the following:
Dim t As Type = Me.GetType
Dim ClassProperties As PropertyInfo() = t.GetProperties
Dim ClassProperty As PropertyInfo
Dim ClassType As System.Type
ClassProperty = t.GetProperty(PropertyName)
ClassType = ClassProperty.PropertyType
DefaultPropertyValue = CType("a", ClassType)
What is wrong with the last line? Intellisense keeps saying that type
'ClassType' is not defined.
The docs say that the typename parameter of CType can be:
"Any expression that is legal within an As clause in a Dim statement, that
is, the name of any data type, object, structure, class, or interface."
Isn't that what I have?
Dim t As Type = Me.GetType
Dim ClassProperties As PropertyInfo() = t.GetProperties
Dim ClassProperty As PropertyInfo
Dim ClassType As System.Type
ClassProperty = t.GetProperty(PropertyName)
ClassType = ClassProperty.PropertyType
DefaultPropertyValue = CType("a", ClassType)
What is wrong with the last line? Intellisense keeps saying that type
'ClassType' is not defined.
The docs say that the typename parameter of CType can be:
"Any expression that is legal within an As clause in a Dim statement, that
is, the name of any data type, object, structure, class, or interface."
Isn't that what I have?