mscorlib(4.0.0.0) API with additions
System.Reflection.Module Class Reference

Performs reflection on a module. More...

Inheritance diagram for System.Reflection.Module:
[legend]
Collaboration diagram for System.Reflection.Module:
[legend]

Public Member Functions

override bool Equals (object o)
 Determines whether this module and the specified object are equal. More...
 
override int GetHashCode ()
 Returns the hash code for this instance. More...
 
override string ToString ()
 Returns the name of the module. More...
 
virtual object [] GetCustomAttributes (bool inherit)
 Returns all custom attributes. More...
 
virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
 Gets custom attributes of the specified type. More...
 
virtual bool IsDefined (Type attributeType, bool inherit)
 Returns a value that indicates whether the specified attribute type has been applied to this module. More...
 
virtual IList< CustomAttributeDataGetCustomAttributesData ()
 Returns a list of T:System.Reflection.CustomAttributeData objects for the current module, which can be used in the reflection-only context. More...
 
MethodBase ResolveMethod (int metadataToken)
 Returns the method or constructor identified by the specified metadata token. More...
 
virtual MethodBase ResolveMethod (int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
 Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters. More...
 
FieldInfo ResolveField (int metadataToken)
 Returns the field identified by the specified metadata token. More...
 
virtual FieldInfo ResolveField (int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
 Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters. More...
 
Type ResolveType (int metadataToken)
 Returns the type identified by the specified metadata token. More...
 
virtual Type ResolveType (int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
 Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters. More...
 
MemberInfo ResolveMember (int metadataToken)
 Returns the type or member identified by the specified metadata token. More...
 
virtual MemberInfo ResolveMember (int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
 Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters. More...
 
virtual byte [] ResolveSignature (int metadataToken)
 Returns the signature blob identified by a metadata token. More...
 
virtual string ResolveString (int metadataToken)
 Returns the string identified by the specified metadata token. More...
 
virtual void GetPEKind (out PortableExecutableKinds peKind, out ImageFileMachine machine)
 Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module. More...
 
virtual void GetObjectData (SerializationInfo info, StreamingContext context)
 Provides an T:System.Runtime.Serialization.ISerializable implementation for serialized objects. More...
 
virtual Type GetType (string className, bool ignoreCase)
 Returns the specified type, searching the module with the specified case sensitivity. More...
 
virtual Type GetType (string className)
 Returns the specified type, performing a case-sensitive search. More...
 
virtual Type GetType (string className, bool throwOnError, bool ignoreCase)
 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. More...
 
virtual Type [] FindTypes (TypeFilter filter, object filterCriteria)
 Returns an array of classes accepted by the given filter and filter criteria. More...
 
virtual Type [] GetTypes ()
 Returns all the types defined within this module. More...
 
virtual bool IsResource ()
 Gets a value indicating whether the object is a resource. More...
 
FieldInfo [] GetFields ()
 Returns the global fields defined on the module. More...
 
virtual FieldInfo [] GetFields (BindingFlags bindingFlags)
 Returns the global fields defined on the module that match the specified binding flags. More...
 
FieldInfo GetField (string name)
 Returns a field having the specified name. More...
 
virtual FieldInfo GetField (string name, BindingFlags bindingAttr)
 Returns a field having the specified name and binding attributes. More...
 
MethodInfo [] GetMethods ()
 Returns the global methods defined on the module. More...
 
virtual MethodInfo [] GetMethods (BindingFlags bindingFlags)
 Returns the global methods defined on the module that match the specified binding flags. More...
 
MethodInfo GetMethod (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
 Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers. More...
 
MethodInfo GetMethod (string name, Type[] types)
 Returns a method having the specified name and parameter types. More...
 
MethodInfo GetMethod (string name)
 Returns a method having the specified name. More...
 
virtual X509Certificate GetSignerCertificate ()
 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. More...
 

Static Public Member Functions

static bool operator== (Module left, Module right)
 Indicates whether two T:System.Reflection.Module objects are equal. More...
 
static bool operator != (Module left, Module right)
 Indicates whether two T:System.Reflection.Module objects are not equal. More...
 

Public Attributes

ModuleHandle ModuleHandle => GetModuleHandle()
 Gets a handle for the module. More...
 

Static Public Attributes

static readonly TypeFilter FilterTypeName
 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. More...
 
static readonly TypeFilter FilterTypeNameIgnoreCase
 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. More...
 

Protected Member Functions

virtual MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
 Returns the method implementation in accordance with the specified criteria. More...
 

Properties

virtual IEnumerable< CustomAttributeDataCustomAttributes [get]
 Gets a collection that contains this module's custom attributes. More...
 
virtual int MDStreamVersion [get]
 Gets the metadata stream version. More...
 
virtual string FullyQualifiedName [get]
 Gets a string representing the fully qualified name and path to this module. More...
 
virtual Guid ModuleVersionId [get]
 Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module. More...
 
virtual int MetadataToken [get]
 Gets a token that identifies the module in metadata. More...
 
virtual string ScopeName [get]
 Gets a string representing the name of the module. More...
 
virtual string Name [get]
 Gets a String representing the name of the module with the path removed. More...
 
virtual Assembly Assembly [get]
 Gets the appropriate T:System.Reflection.Assembly for this instance of T:System.Reflection.Module. More...
 

Detailed Description

Performs reflection on a module.

Definition at line 17 of file Module.cs.

Member Function Documentation

◆ Equals()

override bool System.Reflection.Module.Equals ( object  o)

Determines whether this module and the specified object are equal.

Parameters
oThe object to compare with this instance.
Returns
true if o is equal to this instance; otherwise, false.

Definition at line 194 of file Module.cs.

◆ FindTypes()

virtual Type [] System.Reflection.Module.FindTypes ( TypeFilter  filter,
object  filterCriteria 
)
virtual

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

Parameters
filterThe delegate used to filter the classes.
filterCriteriaAn Object used to filter the classes.
Returns
An array of type Type containing classes that were accepted by the filter.
Exceptions
T:System.Reflection.ReflectionTypeLoadExceptionOne or more classes in a module could not be loaded.

Definition at line 526 of file Module.cs.

◆ GetCustomAttributes() [1/2]

virtual object [] System.Reflection.Module.GetCustomAttributes ( bool  inherit)
virtual

Returns all custom attributes.

Parameters
inheritThis argument is ignored for objects of this type.
Returns
An array of type Object containing all custom attributes.

Implements System.Reflection.ICustomAttributeProvider.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 218 of file Module.cs.

◆ GetCustomAttributes() [2/2]

virtual object [] System.Reflection.Module.GetCustomAttributes ( Type  attributeType,
bool  inherit 
)
virtual

Gets custom attributes of the specified type.

Parameters
attributeTypeThe type of attribute to get.
inheritThis argument is ignored for objects of this type.
Returns
An array of type Object containing all custom attributes of the specified type.
Exceptions
T:System.ArgumentNullExceptionattributeType is null.
T:System.ArgumentExceptionattributeType is not a T:System.Type object supplied by the runtime. For example, attributeType is a T:System.Reflection.Emit.TypeBuilder object.

Implements System.Reflection.ICustomAttributeProvider.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 231 of file Module.cs.

◆ GetCustomAttributesData()

virtual IList<CustomAttributeData> System.Reflection.Module.GetCustomAttributesData ( )
virtual

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

Returns
A generic list of T:System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the current module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 252 of file Module.cs.

◆ GetField() [1/2]

FieldInfo System.Reflection.Module.GetField ( string  name)

Returns a field having the specified name.

Parameters
nameThe field name.
Returns
A FieldInfo object having the specified name, or null if the field does not exist.
Exceptions
T:System.ArgumentNullExceptionThe name parameter is null.

Definition at line 603 of file Module.cs.

◆ GetField() [2/2]

virtual FieldInfo System.Reflection.Module.GetField ( string  name,
BindingFlags  bindingAttr 
)
virtual

Returns a field having the specified name and binding attributes.

Parameters
nameThe field name.
bindingAttrOne of the BindingFlags bit flags used to control the search.
Returns
A FieldInfo object having the specified name and binding attributes, or null if the field does not exist.
Exceptions
T:System.ArgumentNullExceptionThe name parameter is null.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 613 of file Module.cs.

◆ GetFields() [1/2]

FieldInfo [] System.Reflection.Module.GetFields ( )

Returns the global fields defined on the module.

Returns
An array of T:System.Reflection.FieldInfo objects representing the global fields defined on the module; if there are no global fields, an empty array is returned.

Definition at line 581 of file Module.cs.

◆ GetFields() [2/2]

virtual FieldInfo [] System.Reflection.Module.GetFields ( BindingFlags  bindingFlags)
virtual

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

Parameters
bindingFlagsA bitwise combination of T:System.Reflection.BindingFlags values that limit the search.
Returns
An array of type T:System.Reflection.FieldInfo representing the global fields defined on the module that match the specified binding flags; if no global fields match the binding flags, an empty array is returned.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 589 of file Module.cs.

◆ GetHashCode()

override int System.Reflection.Module.GetHashCode ( )

Returns the hash code for this instance.

Returns
A 32-bit signed integer hash code.

Definition at line 202 of file Module.cs.

◆ GetMethod() [1/3]

MethodInfo System.Reflection.Module.GetMethod ( string  name,
BindingFlags  bindingAttr,
Binder  binder,
CallingConventions  callConvention,
Type []  types,
ParameterModifier []  modifiers 
)

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

Parameters
nameThe method name.
bindingAttrOne of the BindingFlags bit flags used to control the search.
binderAn object that implements Binder, containing properties related to this method.
callConventionThe calling convention for the method.
typesThe parameter types to search for.
modifiersAn array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.
Returns
A MethodInfo object in accordance with the specified criteria, or null if the method does not exist.
Exceptions
T:System.ArgumentNullExceptionname is null, types is null, or types (i) is null.

Definition at line 653 of file Module.cs.

◆ GetMethod() [2/3]

MethodInfo System.Reflection.Module.GetMethod ( string  name,
Type []  types 
)

Returns a method having the specified name and parameter types.

Parameters
nameThe method name.
typesThe parameter types to search for.
Returns
A MethodInfo object in accordance with the specified criteria, or null if the method does not exist.
Exceptions
T:System.ArgumentNullExceptionname is null, types is null, or types (i) is null.

Definition at line 679 of file Module.cs.

◆ GetMethod() [3/3]

MethodInfo System.Reflection.Module.GetMethod ( string  name)

Returns a method having the specified name.

Parameters
nameThe method name.
Returns
A MethodInfo object having the specified name, or null if the method does not exist.
Exceptions
T:System.ArgumentNullExceptionname is null.

Definition at line 704 of file Module.cs.

◆ GetMethodImpl()

virtual MethodInfo System.Reflection.Module.GetMethodImpl ( string  name,
BindingFlags  bindingAttr,
Binder  binder,
CallingConventions  callConvention,
Type []  types,
ParameterModifier []  modifiers 
)
protectedvirtual

Returns the method implementation in accordance with the specified criteria.

Parameters
nameThe method name.
bindingAttrOne of the BindingFlags bit flags used to control the search.
binderAn object that implements Binder, containing properties related to this method.
callConventionThe calling convention for the method.
typesThe parameter types to search for.
modifiersAn array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.
Returns
A MethodInfo object containing implementation information as specified, or null if the method does not exist.
Exceptions
T:System.Reflection.AmbiguousMatchExceptiontypes is null.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 723 of file Module.cs.

◆ GetMethods() [1/2]

MethodInfo [] System.Reflection.Module.GetMethods ( )

Returns the global methods defined on the module.

Returns
An array of T:System.Reflection.MethodInfo objects representing all the global methods defined on the module; if there are no global methods, an empty array is returned.

Definition at line 625 of file Module.cs.

◆ GetMethods() [2/2]

virtual MethodInfo [] System.Reflection.Module.GetMethods ( BindingFlags  bindingFlags)
virtual

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

Parameters
bindingFlagsA bitwise combination of T:System.Reflection.BindingFlags values that limit the search.
Returns
An array of type T:System.Reflection.MethodInfo representing the global methods defined on the module that match the specified binding flags; if no global methods match the binding flags, an empty array is returned.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 633 of file Module.cs.

◆ GetObjectData()

virtual void System.Reflection.Module.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
virtual

Provides an T:System.Runtime.Serialization.ISerializable implementation for serialized objects.

Parameters
infoThe information and data needed to serialize or deserialize an object.
contextThe context for the serialization.
Exceptions
T:System.ArgumentNullExceptioninfo is null.

Implements System.Runtime.Serialization.ISerializable.

Definition at line 444 of file Module.cs.

◆ GetPEKind()

virtual void System.Reflection.Module.GetPEKind ( out PortableExecutableKinds  peKind,
out ImageFileMachine  machine 
)
virtual

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

Parameters
peKindWhen this method returns, a combination of the T:System.Reflection.PortableExecutableKinds values indicating the nature of the code in the module.
machineWhen this method returns, one of the T:System.Reflection.ImageFileMachine values indicating the platform targeted by the module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 428 of file Module.cs.

◆ GetSignerCertificate()

virtual X509Certificate System.Reflection.Module.GetSignerCertificate ( )
virtual

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.

Returns
An X509Certificate object, or null if the assembly to which this module belongs has not been Authenticode signed.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 735 of file Module.cs.

◆ GetType() [1/3]

virtual Type System.Reflection.Module.GetType ( string  className,
bool  ignoreCase 
)
virtual

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

Parameters
classNameThe name of the type to locate. The name must be fully qualified with the namespace.
ignoreCasetrue for case-insensitive search; otherwise, false.
Returns
A Type object representing the given type, if the type is in this module; otherwise, null.
Exceptions
T:System.ArgumentNullExceptionclassName is null.
T:System.Reflection.TargetInvocationExceptionThe class initializers are invoked and an exception is thrown.
T:System.ArgumentExceptionclassName is a zero-length string.
T:System.IO.FileNotFoundExceptionclassName requires a dependent assembly that could not be found.
T:System.IO.FileLoadExceptionclassName requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and className requires a dependent assembly that was not preloaded.
T:System.BadImageFormatExceptionclassName requires a dependent assembly, but the file is not a valid assembly. -or- className requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 467 of file Module.cs.

◆ GetType() [2/3]

virtual Type System.Reflection.Module.GetType ( string  className)
virtual

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

Parameters
classNameThe name of the type to locate. The name must be fully qualified with the namespace.
Returns
A Type object representing the given type, if the type is in this module; otherwise, null.
Exceptions
T:System.ArgumentNullExceptionclassName is null.
T:System.Reflection.TargetInvocationExceptionThe class initializers are invoked and an exception is thrown.
T:System.ArgumentExceptionclassName is a zero-length string.
T:System.IO.FileNotFoundExceptionclassName requires a dependent assembly that could not be found.
T:System.IO.FileLoadExceptionclassName requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and className requires a dependent assembly that was not preloaded.
T:System.BadImageFormatExceptionclassName requires a dependent assembly, but the file is not a valid assembly. -or- className requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 488 of file Module.cs.

◆ GetType() [3/3]

virtual Type System.Reflection.Module.GetType ( string  className,
bool  throwOnError,
bool  ignoreCase 
)
virtual

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.

Parameters
classNameThe name of the type to locate. The name must be fully qualified with the namespace.
throwOnErrortrue to throw an exception if the type cannot be found; false to return null.
ignoreCasetrue for case-insensitive search; otherwise, false.
Returns
A T:System.Type object representing the specified type, if the type is declared in this module; otherwise, null.
Exceptions
T:System.ArgumentNullExceptionclassName is null.
T:System.Reflection.TargetInvocationExceptionThe class initializers are invoked and an exception is thrown.
T:System.ArgumentExceptionclassName is a zero-length string.
T:System.TypeLoadExceptionthrowOnError is true, and the type cannot be found.
T:System.IO.FileNotFoundExceptionclassName requires a dependent assembly that could not be found.
T:System.IO.FileLoadExceptionclassName requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and className requires a dependent assembly that was not preloaded.
T:System.BadImageFormatExceptionclassName requires a dependent assembly, but the file is not a valid assembly. -or- className requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 516 of file Module.cs.

◆ GetTypes()

virtual Type [] System.Reflection.Module.GetTypes ( )
virtual

Returns all the types defined within this module.

Returns
An array of type Type containing types defined within the module that is reflected by this instance.
Exceptions
T:System.Reflection.ReflectionTypeLoadExceptionOne or more classes in a module could not be loaded.
T:System.Security.SecurityExceptionThe caller does not have the required permission.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 561 of file Module.cs.

◆ IsDefined()

virtual bool System.Reflection.Module.IsDefined ( Type  attributeType,
bool  inherit 
)
virtual

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

Parameters
attributeTypeThe type of custom attribute to test for.
inheritThis argument is ignored for objects of this type.
Returns
true if one or more instances of attributeType have been applied to this module; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionattributeType is null.
T:System.ArgumentExceptionattributeType is not a T:System.Type object supplied by the runtime. For example, attributeType is a T:System.Reflection.Emit.TypeBuilder object.

Implements System.Reflection.ICustomAttributeProvider.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 245 of file Module.cs.

◆ IsResource()

virtual bool System.Reflection.Module.IsResource ( )
virtual

Gets a value indicating whether the object is a resource.

Returns
true if the object is a resource; otherwise, false.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 569 of file Module.cs.

◆ operator !=()

static bool System.Reflection.Module.operator != ( Module  left,
Module  right 
)
static

Indicates whether two T:System.Reflection.Module objects are not equal.

Parameters
leftThe first object to compare.
rightThe second object to compare.
Returns
true if left is not equal to right ; otherwise, false.

Definition at line 184 of file Module.cs.

◆ operator==()

static bool System.Reflection.Module.operator== ( Module  left,
Module  right 
)
static

Indicates whether two T:System.Reflection.Module objects are equal.

Parameters
leftThe first object to compare.
rightThe second object to compare.
Returns
true if left is equal to right ; otherwise, false.

Definition at line 165 of file Module.cs.

◆ ResolveField() [1/2]

FieldInfo System.Reflection.Module.ResolveField ( int  metadataToken)

Returns the field identified by the specified metadata token.

Parameters
metadataTokenA metadata token that identifies a field in the module.
Returns
A T:System.Reflection.FieldInfo object representing the field that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a field in the scope of the current module.-or- metadataToken identifies a field whose parent TypeSpec has a signature containing element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method).
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Definition at line 298 of file Module.cs.

◆ ResolveField() [2/2]

virtual FieldInfo System.Reflection.Module.ResolveField ( int  metadataToken,
Type []  genericTypeArguments,
Type []  genericMethodArguments 
)
virtual

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

Parameters
metadataTokenA metadata token that identifies a field in the module.
genericTypeArgumentsAn array of T:System.Type objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic.
genericMethodArgumentsAn array of T:System.Type objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic.
Returns
A T:System.Reflection.FieldInfo object representing the field that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a field in the scope of the current module.-or- metadataToken identifies a field whose parent TypeSpec has a signature containing element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments .
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 313 of file Module.cs.

◆ ResolveMember() [1/2]

MemberInfo System.Reflection.Module.ResolveMember ( int  metadataToken)

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

Parameters
metadataTokenA metadata token that identifies a type or member in the module.
Returns
A T:System.Reflection.MemberInfo object representing the type or member that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a type or member in the scope of the current module.-or- metadataToken is a MethodSpec or TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method).-or- metadataToken identifies a property or event.
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Definition at line 365 of file Module.cs.

◆ ResolveMember() [2/2]

virtual MemberInfo System.Reflection.Module.ResolveMember ( int  metadataToken,
Type []  genericTypeArguments,
Type []  genericMethodArguments 
)
virtual

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

Parameters
metadataTokenA metadata token that identifies a type or member in the module.
genericTypeArgumentsAn array of T:System.Type objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic.
genericMethodArgumentsAn array of T:System.Type objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic.
Returns
A T:System.Reflection.MemberInfo object representing the type or member that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a type or member in the scope of the current module.-or- metadataToken is a MethodSpec or TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments .-or- metadataToken identifies a property or event.
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 381 of file Module.cs.

◆ ResolveMethod() [1/2]

MethodBase System.Reflection.Module.ResolveMethod ( int  metadataToken)

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

Parameters
metadataTokenA metadata token that identifies a method or constructor in the module.
Returns
A T:System.Reflection.MethodBase object representing the method or constructor that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a method or constructor in the scope of the current module.-or- metadataToken is a MethodSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method).
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Definition at line 265 of file Module.cs.

◆ ResolveMethod() [2/2]

virtual MethodBase System.Reflection.Module.ResolveMethod ( int  metadataToken,
Type []  genericTypeArguments,
Type []  genericMethodArguments 
)
virtual

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

Parameters
metadataTokenA metadata token that identifies a method or constructor in the module.
genericTypeArgumentsAn array of T:System.Type objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic.
genericMethodArgumentsAn array of T:System.Type objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic.
Returns
A T:System.Reflection.MethodBase object representing the method that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a method or constructor in the scope of the current module.-or- metadataToken is a MethodSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments .
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 280 of file Module.cs.

◆ ResolveSignature()

virtual byte [] System.Reflection.Module.ResolveSignature ( int  metadataToken)
virtual

Returns the signature blob identified by a metadata token.

Parameters
metadataTokenA metadata token that identifies a signature in the module.
Returns
An array of bytes representing the signature blob.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a valid MemberRef, MethodDef, TypeSpec, signature, or FieldDef token in the scope of the current module.
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 398 of file Module.cs.

◆ ResolveString()

virtual string System.Reflection.Module.ResolveString ( int  metadataToken)
virtual

Returns the string identified by the specified metadata token.

Parameters
metadataTokenA metadata token that identifies a string in the string heap of the module.
Returns
A T:System.String containing a string value from the metadata string heap.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a string in the scope of the current module.
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 415 of file Module.cs.

◆ ResolveType() [1/2]

Type System.Reflection.Module.ResolveType ( int  metadataToken)

Returns the type identified by the specified metadata token.

Parameters
metadataTokenA metadata token that identifies a type in the module.
Returns
A T:System.Type object representing the type that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a type in the scope of the current module.-or- metadataToken is a TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method).
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Definition at line 331 of file Module.cs.

◆ ResolveType() [2/2]

virtual Type System.Reflection.Module.ResolveType ( int  metadataToken,
Type []  genericTypeArguments,
Type []  genericMethodArguments 
)
virtual

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

Parameters
metadataTokenA metadata token that identifies a type in the module.
genericTypeArgumentsAn array of T:System.Type objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic.
genericMethodArgumentsAn array of T:System.Type objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic.
Returns
A T:System.Type object representing the type that is identified by the specified metadata token.
Exceptions
T:System.ArgumentExceptionmetadataToken is not a token for a type in the scope of the current module.-or- metadataToken is a TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments .
T:System.ArgumentOutOfRangeExceptionmetadataToken is not a valid token in the scope of the current module.

Reimplemented in System.Reflection.Emit.ModuleBuilder.

Definition at line 346 of file Module.cs.

◆ ToString()

override string System.Reflection.Module.ToString ( )

Returns the name of the module.

Returns
A String representing the name of this module.

Definition at line 210 of file Module.cs.

Member Data Documentation

◆ FilterTypeName

readonly TypeFilter System.Reflection.Module.FilterTypeName
static

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.

Definition at line 20 of file Module.cs.

◆ FilterTypeNameIgnoreCase

readonly TypeFilter System.Reflection.Module.FilterTypeNameIgnoreCase
static

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.

Definition at line 23 of file Module.cs.

◆ ModuleHandle

ModuleHandle System.Reflection.Module.ModuleHandle => GetModuleHandle()

Gets a handle for the module.

Returns
A T:System.ModuleHandle structure for the current module.

Definition at line 148 of file Module.cs.

Property Documentation

◆ Assembly

virtual Assembly System.Reflection.Module.Assembly
get

Gets the appropriate T:System.Reflection.Assembly for this instance of T:System.Reflection.Module.

Returns
An Assembly object.

Definition at line 133 of file Module.cs.

◆ CustomAttributes

virtual IEnumerable<CustomAttributeData> System.Reflection.Module.CustomAttributes
get

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

Returns
A collection that contains this module's custom attributes.

Definition at line 31 of file Module.cs.

◆ FullyQualifiedName

virtual string System.Reflection.Module.FullyQualifiedName
get

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

Returns
The fully qualified module name.
Exceptions
T:System.Security.SecurityExceptionThe caller does not have the required permissions.

Definition at line 59 of file Module.cs.

◆ MDStreamVersion

virtual int System.Reflection.Module.MDStreamVersion
get

Gets the metadata stream version.

Returns
A 32-bit integer representing the metadata stream version. The high-order two bytes represent the major version number, and the low-order two bytes represent the minor version number.

Definition at line 42 of file Module.cs.

◆ MetadataToken

virtual int System.Reflection.Module.MetadataToken
get

Gets a token that identifies the module in metadata.

Returns
An integer token that identifies the current module in metadata.

Definition at line 85 of file Module.cs.

◆ ModuleVersionId

virtual Guid System.Reflection.Module.ModuleVersionId
get

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

Returns
A T:System.Guid that can be used to distinguish between two versions of a module.

Definition at line 70 of file Module.cs.

◆ Name

virtual string System.Reflection.Module.Name
get

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

Returns
The module name with no path.

Definition at line 116 of file Module.cs.

◆ ScopeName

virtual string System.Reflection.Module.ScopeName
get

Gets a string representing the name of the module.

Returns
The module name.

Definition at line 100 of file Module.cs.


The documentation for this class was generated from the following file: