I have a nested set of objects ie some properties are custom objects. I would like to get a object property value within the hierarchy group using a string for the property name, and some form of "find" method to scan the hierarchy to find a property with matching name, and get its value.
Is this possible and if so how?
Many thanks.
EDIT
Class definition may be in pseudocode:
Class Car
Public Window myWindow()
Public Door myDoor()
Class Window
Public Shape()
Class Door
Public Material()
Car myCar = new Car()
myCar.myWindow.Shape ="Round"
myDoor.Material = "Metal"
All a little contrived, but could I "find" the value of the "Shape" property by using the magic string "Shape" in some form of find function, starting from the top object. ie:
string myResult = myCar.FindPropertyValue("Shape")
Hopefully myResult = "Round".
This is what I am after.
Thanks.