1. Reflection overview
Public Language Runture Loader Management Application Domain. Such management includes loading each assembly to the corresponding application domain and controlling the memory layout of each program centralized type hierarchy.
The assembly contains modules, and the module contains types, and the type is also included. Reflection provides an object of package assembly, modules, and types. You can create a type of instance using a reflection, bind the type to an existing object, or get the type from an existing object. Then, you can call the type method or access its fields and properties. Reflection usually has the following uses:
Using Assembly Definitions and Load the assembly, load the modules listed in the assembly list, and find the type of the type and create an instance of this type. Using Module Understand the following similar information: contains the assembly of the module and class in the module. You can also get all global methods or other specific non-global methods defined on the module. Using CONSTRUctorInfo to learn the following similar information: constructor's name, parameters, access modifiers (such as public or private) and implementation of details (such as Abstract or Virtual). Use the Type's getConstructors or getConstructor method to call a specific constructor. Using MethodInfo to learn about the following information: the name, return type, parameter, access modifier (such as public or private) and implementation details (such as Abstract or Virtual). Use the Type's getMethods or getMethod method to call a specific method. Using FieldInfo to learn about the following information: the name of the field, access the modifier (such as public or private) and implementing details (such as static); and gets or sets a field value. Use EventInfo to learn about the following similar information: the name of the event, the event handler data type, custom property, the declaration type, and the type of reflectance, etc .; and add or remove the event handler. Use PropertyInfo to learn about the following similar information: the name of the property, the data type, the declaration type, the reflection type, and only read or can be writable, and the property value is obtained or set. Use ParameterInfo to learn about the following information: the name of the parameter, data type, parameter is the input parameter or output parameters, and the location of the parameters in the method signature.
System.Reflection.emit Namespace class provides a special form of reflections that allow you to construct a type at runtime.
Reflection can also be used to create an application called type browser that allows users to select type and then view information about selected types.
There are other uses in the reflection. Language compilers such as JScript use reflection to construct symbol tables. System.Runtime.Serialization The class in the namespace uses the reflection to access the data and determine the field to be held. The class in the System.Runtime.Remoting namespace is indirectly used by serialization.