Summary
In this chapter we discussed how to use reflection in an active way to control class members. We considered the following topics:
-
Reasons you should consider using dynamic invocation techniques on types and their members
-
How to dynamically invoke methods, properties, and fields using Type.InvokeMember()
-
How to dynamically invoke methods using MethodInfo.Invoke()
-
How to dynamically modify fields and properties using the GetValue() and SetValue() methods of the FieldInfo and PropertyInfo classes
-
Why using dynamic invocation via reflection is not always the best choice, and when you should use delegates instead
In the next chapter, we’ll consider how to create objects using reflection.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2005 Tobin Titus, Syed Fahad Gilani, Mike Gillespie, James Hart, Benny K. Mathew, Andy Olsen, David Curran, Jon Pinnock, Robin Pars, Fabio Claudio Ferracchiati, Sandra Gopikrishna, Tejaswi Redkar, Srinivasa Sivakumar
About this chapter
Cite this chapter
(2005). Using Objects. In: Pro .NET 1.1 Remoting, Reflection, and Threading. Apress. https://doi.org/10.1007/978-1-4302-0025-3_9
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0025-3_9
Publisher Name: Apress
Print ISBN: 978-1-59059-452-0
Online ISBN: 978-1-4302-0025-3
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)