O'Reilly logo

Applied Microsoft® .NET Framework Programming by Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reflecting Over a Type’s Members

Fields, constructors, methods, properties, events, and nested types can all be defined as members within a type. The FCL contains a type called System.Reflection.MemberInfo. The various versions of the Reflector sample application discussed earlier in this chapter used this type to demonstrate how to discover what members a type defines. Table 20-3 shows several properties and methods offered by the MemberInfo type. These properties and methods are common to all type members.

Most of the properties mentioned in Table 20-3 are self-explanatory. However, developers frequently confuse the DeclaringType and ReflectedType properties. To fully understand these properties, let’s define the following type:

class MyType { ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required