System.Reflection.Module Class

public class Module

Base Types

Object
  Module

Assembly

mscorlib

Library

Reflection

Summary

Provides access to module metadata.

Description

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.

]

See Also

System.Reflection Namespace

Members

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


Module.GetField(System.String) Method

public FieldInfo GetField(string name);

Summary

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.

Parameters

name
A String that specifies the name of the field to be returned.

Return Value

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, returns null .

Exceptions

Exception TypeCondition
ArgumentNullExceptionname is null .

Description

[Note: A global public field is a static field with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.GetField(System.String, System.Reflection.BindingFlags) Method

public FieldInfo GetField(string name, BindingFlags bindingAttr);

Summary

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.

Parameters

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 .]

Return Value

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, returns null .

Exceptions

Exception TypeCondition
ArgumentNullExceptionname is null .

Description

[Note: A global field is a field with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.GetFields(System.Reflection.BindingFlags) Method

public FieldInfo[] GetFields(BindingFlags bindingAttr);

Summary

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.

Parameters

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 .]

Return Value

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.

Description

[Note: A global public field is a static field with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.GetFields() Method

public FieldInfo[] GetFields();

Summary

Returns an array whose elements reflect the global public fields that are members of the module reflected by the current instance.

Return Value

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.

Description

[Note: A global public field is a static field with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.GetMethod(System.String, System.Type[]) Method

public MethodInfo GetMethod(string name, Type[] types);

Summary

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.

Parameters

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.

Return Value

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, returns null .

Exceptions

Exception TypeCondition
ArgumentNullExceptionname is null .

-or-

types is null .

-or-

At least one element of types is null .

Description

[Note: A global public method is a static method with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.GetMethod(System.String) Method

public MethodInfo GetMethod(string name);

Summary

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.

Parameters

name
A String that specifies the name of the method to be returned.

Return Value

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, returns null .

Exceptions

Exception TypeCondition
ArgumentNullExceptionname is null .

Description

[Note: A global public method is a static method with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.GetMethods(System.Reflection.BindingFlags) Method

public MethodInfo[] GetMethods(BindingFlags bindingAttr);

Summary

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.

Parameters

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 .]

Return Value

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.

Description

[Note: A global method is a method with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.GetMethods() Method

public MethodInfo[] GetMethods();

Summary

Returns an array whose elements reflect the global public methods that are members of the module reflected by the current instance.

Return Value

An array of MethodInfo objects that reflect the global public methods that are members of the module reflected by the current instance.

Description

[Note: A global public method is a static method with a module-level scope.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.ToString Method

public override string ToString();

Summary

Returns a string representation of the name of the module reflected by the current instance.

Return Value

A String representation of the name of the module reflected by the current instance.

Description

[Note: This method overrides System.Object.ToString.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.Assembly Property

public Assembly Assembly { get; }

Summary

Gets the appropriate assembly for the module reflected by the current instance.

Property Value

A Assembly instance that reflects the assembly that contains the module reflected by the current instance.

Description

This property is read-only.

Library

RuntimeInfrastructure

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.FullyQualifiedName Property

public virtual string FullyQualifiedName { get; }

Summary

Gets a string that represents the full path of the module reflected by the current instance.

Property Value

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>".

Description

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.]

See Also

System.Reflection.Module Class, System.Reflection Namespace

Module.Name Property

public string Name { get; }

Summary

Gets a string containing the name of the module reflected by the current instance, with the path component removed.

Property Value

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>".

Description

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.

]

See Also

System.Reflection.Module Class, System.Reflection Namespace