Working with Reflection

This next section provides an overview of reflection and how it works. In addition, this section provides examples of using reflection to query information at runtime.

Introduction to Reflection

As mentioned in this chapter's introduction, reflection is a technology that allows managed code to inspect various aspects of the code and metadata at runtime. This allows managed code to do simple things such as obtaining a list of the properties belonging to an object instance, or even more complex things such as querying custom attributes or obtaining an image from a resource embedded within an assembly.

How Reflection Works

One of the main keys to making reflection work is understanding that data types are objects. Understanding ...

Get Microsoft® Visual C#® .NET 2003 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.