How can I get base class properties and fields using reflection, so that I can work UP the class hierarchy one level at a time? The goal is to build a tree display showing properties and fields with values of any class instance, just like the debugger Locals window. I need the ability to lazy load each base instance, so that when a “base” tree node is expanded, those properties and fields with values can be shown on demand.
Share
Here is a simple example which does what you specified. I’m sure you can modify this to your specific needs or at least it will point you in the right direction.
You can copy and paste this example into a console application and set a few breakpoints to see how it works.
The code in VB.Net
The same code in C#