Inspecting Types
Central to reflection is the abstract System.Reflection.MemberInfo class. Concrete classes are derived from MemberInfo to form representations of each member type, including constructors, methods, properties, and fields. For general information about each of the .NET member types, see Chapter 5.
Instances of classes derived from MemberInfo are obtained through the methods of the System.Type class; these methods are grouped by the member type they reflect and follow a clear pattern, each offering three forms, as shown in the following list:
GetXXX(System.Type[])
GetXXXs(System.Reflection.BindingFlags)
GetXXXs()
The XXX indicates a member type—for example, GetConstructor(Type[]), GetConstructors(BindingFlags), and GetConstructors()
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.
Read now
Unlock full access