Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Module Class

Performs reflection on a module.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

[SerializableAttribute]
[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType.None)]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Unrestricted = true)]
public abstract class Module : _Module, 
	ISerializable, ICustomAttributeProvider

The Module type exposes the following members.

  NameDescription
Protected methodModuleInitializes a new instance of the Module class.
Top

  NameDescription
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryAssemblyGets the appropriate Assembly for this instance of Module.
Public propertySupported by the XNA FrameworkFullyQualifiedNameGets a string representing the fully qualified name and path to this module.
Public propertyMDStreamVersionGets the metadata stream version.
Public propertyMetadataTokenGets a token that identifies the module in metadata.
Public propertyModuleHandleGets a handle for the module.
Public propertyModuleVersionIdGets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module.
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryNameGets a String representing the name of the module with the path removed.
Public propertyScopeNameGets a string representing the name of the module.
Top

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryEqualsDetermines whether this module and the specified object are equal. (Overrides Object.Equals(Object).)

In XNA Framework 3.0, this member is inherited from Object.Equals(Object).


In Portable Class Library Portable Class Library, this member is inherited from Object.Equals(Object).
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFindTypesReturns an array of classes accepted by the given filter and filter criteria.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetCustomAttributes(Boolean)Returns all custom attributes.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetCustomAttributes(Type, Boolean)Gets custom attributes of the specified type.
Public methodGetCustomAttributesDataReturns a list of CustomAttributeData objects for the current module, which can be used in the reflection-only context.
Public methodGetField(String)Returns a field having the specified name.
Public methodGetField(String, BindingFlags)Returns a field having the specified name and binding attributes.
Public methodGetFields()Returns the global fields defined on the module.
Public methodGetFields(BindingFlags)Returns the global fields defined on the module that match the specified binding flags.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetHashCodeReturns the hash code for this instance. (Overrides Object.GetHashCode().)

In XNA Framework 3.0, this member is inherited from Object.GetHashCode().


In Portable Class Library Portable Class Library, this member is inherited from Object.GetHashCode().
Public methodGetMethod(String)Returns a method having the specified name.
Public methodGetMethod(String, Type[])Returns a method having the specified name and parameter types.
Public methodGetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers.
Protected methodGetMethodImplReturns the method implementation in accordance with the specified criteria.
Public methodGetMethods()Returns the global methods defined on the module.
Public methodGetMethods(BindingFlags)Returns the global methods defined on the module that match the specified binding flags.
Public methodGetObjectDataProvides an ISerializable implementation for serialized objects.
Public methodGetPEKindGets a pair of values indicating the nature of the code in a module and the platform targeted by the module.
Public methodGetSignerCertificateReturns an X509Certificate object corresponding to the certificate included in the Authenticode signature of the assembly which this module belongs to. If the assembly has not been Authenticode signed, null is returned.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetType()Gets the Type of the current instance. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetType(String)Returns the specified type, performing a case-sensitive search.
Public methodGetType(String, Boolean)Returns the specified type, searching the module with the specified case sensitivity.
Public methodGetType(String, Boolean, Boolean)Returns the specified type, specifying whether to make a case-sensitive search of the module and whether to throw an exception if the type cannot be found.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetTypesReturns all the types defined within this module.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryIsDefinedReturns a value that indicates whether the specified attribute type has been applied to this module.
Public methodIsResourceGets a value indicating whether the object is a resource.
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodResolveField(Int32)Returns the field identified by the specified metadata token.
Public methodResolveField(Int32, Type[], Type[])Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters.
Public methodResolveMember(Int32)Returns the type or member identified by the specified metadata token.
Public methodResolveMember(Int32, Type[], Type[])Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters.
Public methodResolveMethod(Int32)Returns the method or constructor identified by the specified metadata token.
Public methodResolveMethod(Int32, Type[], Type[])Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters.
Public methodResolveSignatureReturns the signature blob identified by a metadata token.
Public methodResolveStringReturns the string identified by the specified metadata token.
Public methodResolveType(Int32)Returns the type identified by the specified metadata token.
Public methodResolveType(Int32, Type[], Type[])Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryToStringReturns the name of the module. (Overrides Object.ToString().)
Top

  NameDescription
Public operatorStatic memberEqualityIndicates whether two Module objects are equal.
Public operatorStatic memberInequalityIndicates whether two Module objects are not equal.
Top

  NameDescription
Public fieldStatic memberFilterTypeNameA TypeFilter object that filters the list of types defined in this module based upon the name. This field is case-sensitive and read-only.
Public fieldStatic memberFilterTypeNameIgnoreCaseA TypeFilter object that filters the list of types defined in this module based upon the name. This field is case-insensitive and read-only.
Top

  NameDescription
Explicit interface implemetationPrivate method_Module.GetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers.
Explicit interface implemetationPrivate method_Module.GetTypeInfoRetrieves the type information for an object, which can then be used to get the type information for an interface.
Explicit interface implemetationPrivate method_Module.GetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1).
Explicit interface implemetationPrivate method_Module.InvokeProvides access to properties and methods exposed by an object.
Top

A module is a portable executable file, such as type.dll or application.exe, consisting of one or more classes and interfaces. There may be multiple namespaces contained in a single module, and a namespace may span multiple modules.

One or more modules deployed as a unit compose an assembly. For information about creating an assembly with more than one module, see Multifile Assemblies.

Note that a .NET Framework module is not the same as a module in Visual Basic, which is used by a programmers to organize functions and subroutines in an application.

The following code examples show how to use reflection to get information about modules:


using System.Reflection;
using System;
public class Program {

    public static void Main() {
        Class1 c1 = new Class1();
        //  Show the current module.
        Module m = c1.GetType().Module;
        Console.WriteLine("The current module is {0}.", m.Name);

        //  List all modules in the assembly.
        Assembly curAssembly = Assembly.GetExecutingAssembly();
        Console.WriteLine("The current executing assembly is {0}.", curAssembly);

        Module[] mods = curAssembly.GetModules();
        foreach (Module md in mods) {
            Console.WriteLine("This assembly contains the {0} module", md.Name);
        }
        Console.ReadLine();
    }
}
class Class1 {
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

Show:
© 2014 Microsoft