kblair
Member
- Joined
- Feb 11, 2010
- Messages
- 8
- Programming Experience
- 1-3
I am trying to create an object browser similar to what VS2010 uses for the quick watch window. I can use reflection to iterate through the properties and display their names and values until I get to the point in an object where the property is an object of my own creation and not a system type. I can't seem to find the correct approach to be able to iterate the properties of these "sub objects".
Below is the just of what I am trying to do
Thanks for you help,
Kent
Below is the just of what I am trying to do
VB.NET:
Public class myClass
property myprop a string
property myprop2 as double
property myProp3 as myObject
.
.
.
end class
Public Class myObject
property myObjProp as string
.
.
End Class
sub ShowObject (this as myClass)
dim strName as string
dim strValue as string
For Each Prop As System.Reflection.PropertyInfo In This.GetType.GetProperties
'works fine for system types (string, double, int32, ect)
strName = prop.name
strValue = prop.getvalue(this,nothing).tostring
'display strName & strValue in a grid
'if the prop.propertytype is not a system type then
'iterate through the object properties i.e. this.myObject.myObjProp
next
end sub
Thanks for you help,
Kent
Last edited: