Skip to Main Content
Programming .NET Components, 2nd Edition
book

Programming .NET Components, 2nd Edition

by Juval Lowy
July 2005
Intermediate to advanced content levelIntermediate to advanced
644 pages
17h
English
O'Reilly Media, Inc.
Content preview from Programming .NET Components, 2nd Edition

Appendix C. Reflection and Attributes

Reflection is the programmatic act of reading the metadata associated with a type. You can read the metadata to learn what the type is and what is it made of (i.e., methods, properties, base classes). Reflection services are defined in the System.Reflection namespace. Reflection is most useful in conjunction with attributes, which are a way of adding information to a type and affecting the type’s behavior. Reflection also has another esoteric feature not covered in this appendix: it allows you to define new types during runtime and emit the corresponding IL code and metadata (using the services found in the System.Reflection.Emit namespace). This appendix starts by reviewing some key .NET reflection techniques and then focuses on using and defining attributes.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms Programming in C#

Windows Forms Programming in C#

Chris Sells
Metaprogramming in .NET

Metaprogramming in .NET

Jason Bock, Kevin Hazzard
.NET Windows Forms in a Nutshell

.NET Windows Forms in a Nutshell

Ian Griffiths, Matthew Adams

Publisher Resources

ISBN: 0596102070Supplemental ContentErrata Page