From the course: CLR Reflection for Developers
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Reflection types demo - Windows Tutorial
From the course: CLR Reflection for Developers
Reflection types demo
- So, let's start building a tiny little console application that will use Reflection to tell us the members that are on this point class. Now again, this is a bit of a pedagogical exercise, because obviously we see the type information right here for point. But you could easily imagine building such a utility to duplicate the functionality of ILdasm, and/or couple of other scenarios, such as, for example, if you wanted to build your own serialization framework, you're on object relational mapper, et cetera, you would use these techniques. I'm just keeping point inside the same assembly, to make it easier to do the demo, to be very blunt. To do Reflection, the one thing we will need is we will need the system.reflection namespace. So, we'll just bring that in using a using statement. And then, just to give us a basic idea of what we're working with, let's go ahead and get a hold of the point type just to be able to display what we get. So, point type, to get a hold of a particular…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.