Join Ted Neward for an in-depth discussion in this video Constructing objects, part of CLR Reflection for Developers.
- [Instructor] So one of the things…that we can use the reflective API to do…is we can actually, for example,…once we have hold of a constructor info object,…we can actually use that and invoke it…in order to construct a particular object.…The means for doing so is actually very straightforward.…Once we have the constructor info instance…and again, when we get a hold of the constructor,…the parameter list will be important…to know which constructor we're about to invoke,…but also because we're going to need to make sure…on our end that the parameters that we use line up…against the constructor info object…and the constructor that it represents.…
Once we know that, though,…we can simply call the invoke method,…which is part of the constructor info object,…and pass it an object array that lines up…one to one with the parameter list.…Assuming that works, the result of that call…will in fact be a constructed object reference.…Let me show you what we mean here.…
- Working with the IL Disassembler (Ildasm)
- Namespaces and types
- Type API
- Properties API
- MethodBase and MethodInfo API
- Constructors API
- Fields API
- Constructing objects
- Accessing properties and fields
- Invoking methods
Skill Level Intermediate
Deploying .NET Applications with Octopus Deploywith Floyd Hilton1h 27m Intermediate
2. IL Disassembler (Ildasm)
3. Reflection Namespace and Types
4. Type API
5. Properties API
6. MethodBase and MethodInfo API
7. Constructors API
Constructors API demo2m 52s
8. Fields API
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.