Hi.
I am having some trouble using Refelction to list the properties of a user defined structure. I need to get a list of the properties and their values.
Here is the structure:
Public Structure typ_Hole
Friend Type As enum_Hole_Type
Friend Index As Integer
Friend Face As String
Friend x As typ_Coordinate_Data
Friend y As typ_Coordinate_Data
Friend Diameter As Double
Friend Misc_1 As Double
Friend Misc_2 As Double
Friend Length As Double
Friend Angle As Double
Friend Remarks As String
End Structure
Here is the code:
For Each Hole As typ_Hole In m_Holes 'm_Holes is an array of typ_Hole
Dim _info As System.Reflection.PropertyInfo() = _
Hole.GetType.GetProperties
For index As Integer = 0 To _info.Length - 1
' I have defined the structure typ_Hole as shown
' The problem is that this code doesn't list
' the properties and value. The _info collection
' is always empty.
Next
Next
Could anyone please shed some light on this matter?
Thanks,
Joel
I am having some trouble using Refelction to list the properties of a user defined structure. I need to get a list of the properties and their values.
Here is the structure:
Public Structure typ_Hole
Friend Type As enum_Hole_Type
Friend Index As Integer
Friend Face As String
Friend x As typ_Coordinate_Data
Friend y As typ_Coordinate_Data
Friend Diameter As Double
Friend Misc_1 As Double
Friend Misc_2 As Double
Friend Length As Double
Friend Angle As Double
Friend Remarks As String
End Structure
Here is the code:
For Each Hole As typ_Hole In m_Holes 'm_Holes is an array of typ_Hole
Dim _info As System.Reflection.PropertyInfo() = _
Hole.GetType.GetProperties
For index As Integer = 0 To _info.Length - 1
' I have defined the structure typ_Hole as shown
' The problem is that this code doesn't list
' the properties and value. The _info collection
' is always empty.
Next
Next
Could anyone please shed some light on this matter?
Thanks,
Joel