public class Module
Object
Module
mscorlib
Reflection
Provides access to module metadata.
A module is a single portable executable (PE) file.[Note: One or more modules deployed as a unit composes an assembly.
For more information on modules, see Partition II of the CLI Specification.
]
System.Reflection Namespace
Module Methods
Module.GetField(System.String) Method
Module.GetField(System.String, System.Reflection.BindingFlags) Method
Module.GetFields(System.Reflection.BindingFlags) Method
Module.GetFields() Method
Module.GetMethod(System.String, System.Type[]) Method
Module.GetMethod(System.String) Method
Module.GetMethods(System.Reflection.BindingFlags) Method
Module.GetMethods() Method
Module.ToString Method
Module Properties
Module.Assembly Property
Module.FullyQualifiedName Property
Module.Name Property
public FieldInfo GetField(string name);
Returns a FieldInfo instance that reflects the global public field that has the specified name, and is a member of the module reflected by the current instance.
- name
- A String that specifies the name of the field to be returned.
Returns a FieldInfo instance that reflects the global public field that has the name name, and is a member of the module reflected by the current instance, if found; otherwise, returnsnull
.
Exception Type Condition ArgumentNullException name is null
.
[Note: A global public field is a static field with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public FieldInfo GetField(string name, BindingFlags bindingAttr);
Returns a FieldInfo instance that reflects the global field that has the specified name and has the specified binding attributes, and is a member of the module reflected by the current instance.
- name
- A String that specifies the name of the field to be returned.
- bindingAttr
- A bitwise combination of BindingFlags value that control the binding process. [Note: Specify System.Reflection.BindingFlags.Public or System.Reflection.BindingFlags.NonPublic, or System.Reflection.BindingFlags.Static ; otherwise, this method will return
null
.]
Returns a FieldInfo instance that reflects the global field that has the name name and characteristics specified by bindingAttr, and is a member of the module reflected by the current instance, if found; otherwise, returnsnull
.
Exception Type Condition ArgumentNullException name is null
.
[Note: A global field is a field with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public FieldInfo[] GetFields(BindingFlags bindingAttr);
Returns an array whose elements reflect the global fields that have the specified binding attributes, and are members of the module reflected by the current instance.
- bindingAttr
- A bitwise combination of BindingFlags values that control the binding process. [Note: Specify System.Reflection.BindingFlags.Public or System.Reflection.BindingFlags.NonPublic, and System.Reflection.BindingFlags.Static; otherwise, this method will return
null
.]
An array FieldInfo objects that reflect the global fields that have the specified binding attributes, and are members of the module reflected by the current instance. If no global fields are contained in the module reflected by the current instance, returns an array with zero elements.
[Note: A global public field is a static field with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public FieldInfo[] GetFields();
Returns an array whose elements reflect the global public fields that are members of the module reflected by the current instance.
An array of FieldInfo objects that reflect the global public fields that are members of the module reflected by the current instance. If no global public fields are contained in the module reflected by the current instance, returns an array with zero elements.
[Note: A global public field is a static field with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public MethodInfo GetMethod(string name, Type[] types);
Returns a MethodInfo instance that reflects the global public method that has the specified name and parameter types, and is a member of the module reflected by the current instance.
- name
- A String that specifies the name of the method to be returned.
- types
- An array of Type objects that contain the parameter types to search for.
A MethodInfo instance that reflects the global public method that has the name name and parameter types types, and is a member of the module reflected by the current instance, if found; otherwise, returnsnull
.
Exception Type Condition ArgumentNullException name is null
.-or-
types is
null
.-or-
At least one element of types is
null
.
[Note: A global public method is a static method with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public MethodInfo GetMethod(string name);
Returns a MethodInfo instance that reflects the global public method that has the specified name, and is a member of the module reflected by the current instance.
- name
- A String that specifies the name of the method to be returned.
A MethodInfo instance that reflects the global public method that has the name name, and is a member of the module reflected by the current instance, if found; otherwise, returnsnull
.
Exception Type Condition ArgumentNullException name is null
.
[Note: A global public method is a static method with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public MethodInfo[] GetMethods(BindingFlags bindingAttr);
Returns an array whose elements reflect the global methods that have the specified binding attributes, and are members of the module reflected by the current instance.
- bindingAttr
- A bitwise combination of BindingFlags values that control the binding process. [Note: Specify System.Reflection.BindingFlags.Public or System.Reflection.BindingFlags.NonPublic, and System.Reflection.BindingFlags.Static; otherwise, this method will return
null
.]
An array of MethodInfo objects that reflect the global methods that have characteristics specified by bindingAttr, and are members of the module reflected by the current instance, if found; otherwise, returns null.
[Note: A global method is a method with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public MethodInfo[] GetMethods();
Returns an array whose elements reflect the global public methods that are members of the module reflected by the current instance.
An array of MethodInfo objects that reflect the global public methods that are members of the module reflected by the current instance.
[Note: A global public method is a static method with a module-level scope.]
System.Reflection.Module Class, System.Reflection Namespace
public override string ToString();
Returns a string representation of the name of the module reflected by the current instance.
A String representation of the name of the module reflected by the current instance.
[Note: This method overrides System.Object.ToString.]
System.Reflection.Module Class, System.Reflection Namespace
public Assembly Assembly { get; }
Gets the appropriate assembly for the module reflected by the current instance.
A Assembly instance that reflects the assembly that contains the module reflected by the current instance.
This property is read-only.
RuntimeInfrastructure
System.Reflection.Module Class, System.Reflection Namespace
public virtual string FullyQualifiedName { get; }
Gets a string that represents the full path of the module reflected by the current instance.
A String that represents the full path of the module reflected by the current instance. If the assembly that contains the module reflected by the current instance was loaded from a Byte array, the value of this string is "<Unknown>".
This property is read-only.[Behaviors: The case-sensitivity of the module name is implementation-specific. ]
[Overrides: Override this property to customize the content of the String returned by this property in types derived from Module .]
[Usage: To obtain the name of the module without path information, use the System.Reflection.Module.Name property.]
System.Reflection.Module Class, System.Reflection Namespace
public string Name { get; }
Gets a string containing the name of the module reflected by the current instance, with the path component removed.
A String containing the name of the module reflected by the current instance, with the path component removed. If the assembly that contains the module reflected by the current instance was loaded from a Byte array, the value of this string is "<Unknown>".
This property is read-only.[Note: The value of this property is equivalent to the value of the string returned by the System.Reflection.Module.ToString method.
Use System.Reflection.Module.FullyQualifiedName to get the name and path of the module reflected by the current instance.
]
System.Reflection.Module Class, System.Reflection Namespace