August 2003
Beginner to intermediate
600 pages
12h 57m
English
The Reflection API also provides the ability to search for and invoke methods that you may not have knowledge of at compile time. Before you can invoke a method, you must successfully request a MethodInfo object from the Type object. In this section we will investigate three ways to retrieve a MethodInfo from a Type object.
The easiest way to retrieve a MethodInfo object is to search for the method by name. The Type object provides the GetMethod(string methodName) to do just this. The string parameter contains the case-sensitive name of the public method to get. If you request a nonpublic method or a method that does not exist, then a null reference is returned. ...
Read now
Unlock full access