Module Class
TOC
Collapse the table of content
Expand the table of content

Module Class

 

Performs reflection on a module.

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


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

NameDescription
System_CAPS_protmethodModule()

Initializes a new instance of the Module class.

NameDescription
System_CAPS_pubpropertyAssembly

Gets the appropriate Assembly for this instance of Module.

System_CAPS_pubpropertyCustomAttributes

Gets a collection that contains this module's custom attributes.

System_CAPS_pubpropertyFullyQualifiedName

Gets a string representing the fully qualified name and path to this module.

System_CAPS_pubpropertyMDStreamVersion

Gets the metadata stream version.

System_CAPS_pubpropertyMetadataToken

Gets a token that identifies the module in metadata.

System_CAPS_pubpropertyModuleHandle

Gets a handle for the module.

System_CAPS_pubpropertyModuleVersionId

Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module.

System_CAPS_pubpropertyName

Gets a String representing the name of the module with the path removed.

System_CAPS_pubpropertyScopeName

Gets a string representing the name of the module.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether this module and the specified object are equal.(Overrides Object.Equals(Object).)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodFindTypes(TypeFilter, Object)

Returns an array of classes accepted by the given filter and filter criteria.

System_CAPS_pubmethodGetCustomAttributes(Boolean)

Returns all custom attributes.

System_CAPS_pubmethodGetCustomAttributes(Type, Boolean)

Gets custom attributes of the specified type.

System_CAPS_pubmethodGetCustomAttributesData()

Returns a list of CustomAttributeData objects for the current module, which can be used in the reflection-only context.

System_CAPS_pubmethodGetField(String)

Returns a field having the specified name.

System_CAPS_pubmethodGetField(String, BindingFlags)

Returns a field having the specified name and binding attributes.

System_CAPS_pubmethodGetFields()

Returns the global fields defined on the module.

System_CAPS_pubmethodGetFields(BindingFlags)

Returns the global fields defined on the module that match the specified binding flags.

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Overrides Object.GetHashCode().)

System_CAPS_pubmethodGetMethod(String)

Returns a method having the specified name.

System_CAPS_pubmethodGetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers.

System_CAPS_pubmethodGetMethod(String, Type[])

Returns a method having the specified name and parameter types.

System_CAPS_protmethodGetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Returns the method implementation in accordance with the specified criteria.

System_CAPS_pubmethodGetMethods()

Returns the global methods defined on the module.

System_CAPS_pubmethodGetMethods(BindingFlags)

Returns the global methods defined on the module that match the specified binding flags.

System_CAPS_pubmethodGetObjectData(SerializationInfo, StreamingContext)

Provides an ISerializable implementation for serialized objects.

System_CAPS_pubmethodGetPEKind(PortableExecutableKinds, ImageFileMachine)

Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module.

System_CAPS_pubmethodGetSignerCertificate()

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

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetType(String)

Returns the specified type, performing a case-sensitive search.

System_CAPS_pubmethodGetType(String, Boolean)

Returns the specified type, searching the module with the specified case sensitivity.

System_CAPS_pubmethodGetType(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.

System_CAPS_pubmethodGetTypes()

Returns all the types defined within this module.

System_CAPS_pubmethodIsDefined(Type, Boolean)

Returns a value that indicates whether the specified attribute type has been applied to this module.

System_CAPS_pubmethodIsResource()

Gets a value indicating whether the object is a resource.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodResolveField(Int32)

Returns the field identified by the specified metadata token.

System_CAPS_pubmethodResolveField(Int32, Type[], Type[])

Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters.

System_CAPS_pubmethodResolveMember(Int32)

Returns the type or member identified by the specified metadata token.

System_CAPS_pubmethodResolveMember(Int32, Type[], Type[])

Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters.

System_CAPS_pubmethodResolveMethod(Int32)

Returns the method or constructor identified by the specified metadata token.

System_CAPS_pubmethodResolveMethod(Int32, Type[], Type[])

Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters.

System_CAPS_pubmethodResolveSignature(Int32)

Returns the signature blob identified by a metadata token.

System_CAPS_pubmethodResolveString(Int32)

Returns the string identified by the specified metadata token.

System_CAPS_pubmethodResolveType(Int32)

Returns the type identified by the specified metadata token.

System_CAPS_pubmethodResolveType(Int32, Type[], Type[])

Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters.

System_CAPS_pubmethodToString()

Returns the name of the module.(Overrides Object.ToString().)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticFilterTypeName

A TypeFilter object that filters the list of types defined in this module based upon the name. This field is case-sensitive and read-only.

System_CAPS_pubfieldSystem_CAPS_staticFilterTypeNameIgnoreCase

A TypeFilter object that filters the list of types defined in this module based upon the name. This field is case-insensitive and read-only.

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(Module, Module)

Indicates whether two Module objects are equal.

System_CAPS_puboperatorSystem_CAPS_staticInequality(Module, Module)

Indicates whether two Module objects are not equal.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Maps a set of names to a corresponding set of dispatch identifiers.

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.GetTypeInfo(UInt32, UInt32, IntPtr)

Retrieves the type information for an object, which can then be used to get the type information for an interface.

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.GetTypeInfoCount(UInt32)

Retrieves the number of type information interfaces that an object provides (either 0 or 1).

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Provides access to properties and methods exposed by an object.

NameDescription
System_CAPS_pubmethodGetCustomAttribute(Type)

Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodGetCustomAttribute<T>()

Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodGetCustomAttributes()

Overloaded. Retrieves a collection of custom attributes that are applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodGetCustomAttributes(Type)

Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodIsDefined(Type)

Overloaded. Indicates whether custom attributes of a specified type are applied to a specified module.(Defined by CustomAttributeExtensions.)

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 = typeof(Program).Assembly;
        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 {
}

SecurityAction.InheritanceDemand

for full trust for inheritors. This class cannot be inherited by partially trusted code.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1

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

Return to top
Show:
© 2016 Microsoft