mscorlib(4.0.0.0) API with additions
|
Performs reflection on a module. More...
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< CustomAttributeData > | GetCustomAttributesData () |
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< CustomAttributeData > | CustomAttributes [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... | |
override bool System.Reflection.Module.Equals | ( | object | o | ) |
|
virtual |
Returns an array of classes accepted by the given filter and filter criteria.
filter | The delegate used to filter the classes. |
filterCriteria | An Object used to filter the classes. |
Type
containing classes that were accepted by the filter.T:System.Reflection.ReflectionTypeLoadException | One or more classes in a module could not be loaded. |
|
virtual |
Returns all custom attributes.
inherit | This argument is ignored for objects of this type. |
Object
containing all custom attributes.Implements System.Reflection.ICustomAttributeProvider.
Reimplemented in System.Reflection.Emit.ModuleBuilder.
|
virtual |
Gets custom attributes of the specified type.
attributeType | The type of attribute to get. |
inherit | This argument is ignored for objects of this type. |
Object
containing all custom attributes of the specified type.T:System.ArgumentNullException | attributeType is null . |
T:System.ArgumentException | attributeType 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.
|
virtual |
Returns a list of T:System.Reflection.CustomAttributeData objects for the current module, which can be used in the reflection-only context.
Reimplemented in System.Reflection.Emit.ModuleBuilder.
FieldInfo System.Reflection.Module.GetField | ( | string | name | ) |
|
virtual |
Returns a field having the specified name and binding attributes.
name | The field name. |
bindingAttr | One of the BindingFlags bit flags used to control the search. |
FieldInfo
object having the specified name and binding attributes, or null
if the field does not exist.T:System.ArgumentNullException | The name parameter is null . |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
FieldInfo [] System.Reflection.Module.GetFields | ( | ) |
|
virtual |
Returns the global fields defined on the module that match the specified binding flags.
bindingFlags | A bitwise combination of T:System.Reflection.BindingFlags values that limit the search. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
override int System.Reflection.Module.GetHashCode | ( | ) |
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.
name | The method name. |
bindingAttr | One of the BindingFlags bit flags used to control the search. |
binder | An object that implements Binder , containing properties related to this method. |
callConvention | The calling convention for the method. |
types | The parameter types to search for. |
modifiers | An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified. |
MethodInfo
object in accordance with the specified criteria, or null
if the method does not exist.T:System.ArgumentNullException | name is null , types is null , or types (i) is null . |
MethodInfo System.Reflection.Module.GetMethod | ( | string | name, |
Type [] | types | ||
) |
Returns a method having the specified name and parameter types.
name | The method name. |
types | The parameter types to search for. |
MethodInfo
object in accordance with the specified criteria, or null
if the method does not exist.T:System.ArgumentNullException | name is null , types is null , or types (i) is null . |
MethodInfo System.Reflection.Module.GetMethod | ( | string | name | ) |
Returns a method having the specified name.
name | The method name. |
MethodInfo
object having the specified name, or null
if the method does not exist.T:System.ArgumentNullException | name is null . |
|
protectedvirtual |
Returns the method implementation in accordance with the specified criteria.
name | The method name. |
bindingAttr | One of the BindingFlags bit flags used to control the search. |
binder | An object that implements Binder , containing properties related to this method. |
callConvention | The calling convention for the method. |
types | The parameter types to search for. |
modifiers | An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified. |
MethodInfo
object containing implementation information as specified, or null
if the method does not exist.T:System.Reflection.AmbiguousMatchException | types is null . |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
MethodInfo [] System.Reflection.Module.GetMethods | ( | ) |
|
virtual |
Returns the global methods defined on the module that match the specified binding flags.
bindingFlags | A bitwise combination of T:System.Reflection.BindingFlags values that limit the search. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
|
virtual |
Provides an T:System.Runtime.Serialization.ISerializable implementation for serialized objects.
info | The information and data needed to serialize or deserialize an object. |
context | The context for the serialization. |
T:System.ArgumentNullException | info is null . |
Implements System.Runtime.Serialization.ISerializable.
|
virtual |
Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module.
peKind | When this method returns, a combination of the T:System.Reflection.PortableExecutableKinds values indicating the nature of the code in the module. |
machine | When this method returns, one of the T:System.Reflection.ImageFileMachine values indicating the platform targeted by the module. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
|
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.
X509Certificate
object, or null
if the assembly to which this module belongs has not been Authenticode signed.Reimplemented in System.Reflection.Emit.ModuleBuilder.
|
virtual |
Returns the specified type, searching the module with the specified case sensitivity.
className | The name of the type to locate. The name must be fully qualified with the namespace. |
ignoreCase | true for case-insensitive search; otherwise, false . |
Type
object representing the given type, if the type is in this module; otherwise, null
.T:System.ArgumentNullException | className is null . |
T:System.Reflection.TargetInvocationException | The class initializers are invoked and an exception is thrown. |
T:System.ArgumentException | className is a zero-length string. |
T:System.IO.FileNotFoundException | className requires a dependent assembly that could not be found. |
T:System.IO.FileLoadException | className 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.BadImageFormatException | className 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.
|
virtual |
Returns the specified type, performing a case-sensitive search.
className | The name of the type to locate. The name must be fully qualified with the namespace. |
Type
object representing the given type, if the type is in this module; otherwise, null
.T:System.ArgumentNullException | className is null . |
T:System.Reflection.TargetInvocationException | The class initializers are invoked and an exception is thrown. |
T:System.ArgumentException | className is a zero-length string. |
T:System.IO.FileNotFoundException | className requires a dependent assembly that could not be found. |
T:System.IO.FileLoadException | className 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.BadImageFormatException | className 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.
|
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.
className | The name of the type to locate. The name must be fully qualified with the namespace. |
throwOnError | true to throw an exception if the type cannot be found; false to return null . |
ignoreCase | true for case-insensitive search; otherwise, false . |
null
.T:System.ArgumentNullException | className is null . |
T:System.Reflection.TargetInvocationException | The class initializers are invoked and an exception is thrown. |
T:System.ArgumentException | className is a zero-length string. |
T:System.TypeLoadException | throwOnError is true , and the type cannot be found. |
T:System.IO.FileNotFoundException | className requires a dependent assembly that could not be found. |
T:System.IO.FileLoadException | className 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.BadImageFormatException | className 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.
|
virtual |
Returns all the types defined within this module.
Type
containing types defined within the module that is reflected by this instance.T:System.Reflection.ReflectionTypeLoadException | One or more classes in a module could not be loaded. |
T:System.Security.SecurityException | The caller does not have the required permission. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
|
virtual |
Returns a value that indicates whether the specified attribute type has been applied to this module.
attributeType | The type of custom attribute to test for. |
inherit | This argument is ignored for objects of this type. |
true
if one or more instances of attributeType have been applied to this module; otherwise, false
.T:System.ArgumentNullException | attributeType is null . |
T:System.ArgumentException | attributeType 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.
|
virtual |
Gets a value indicating whether the object is a resource.
true
if the object is a resource; otherwise, false
.Reimplemented in System.Reflection.Emit.ModuleBuilder.
FieldInfo System.Reflection.Module.ResolveField | ( | int | metadataToken | ) |
Returns the field identified by the specified metadata token.
metadataToken | A metadata token that identifies a field in the module. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
|
virtual |
Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters.
metadataToken | A metadata token that identifies a field in the module. |
genericTypeArguments | An 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. |
genericMethodArguments | An 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. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
MemberInfo System.Reflection.Module.ResolveMember | ( | int | metadataToken | ) |
Returns the type or member identified by the specified metadata token.
metadataToken | A metadata token that identifies a type or member in the module. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
|
virtual |
Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters.
metadataToken | A metadata token that identifies a type or member in the module. |
genericTypeArguments | An 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. |
genericMethodArguments | An 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. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
MethodBase System.Reflection.Module.ResolveMethod | ( | int | metadataToken | ) |
Returns the method or constructor identified by the specified metadata token.
metadataToken | A metadata token that identifies a method or constructor in the module. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
|
virtual |
Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters.
metadataToken | A metadata token that identifies a method or constructor in the module. |
genericTypeArguments | An 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. |
genericMethodArguments | An 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. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
|
virtual |
Returns the signature blob identified by a metadata token.
metadataToken | A metadata token that identifies a signature in the module. |
T:System.ArgumentException | metadataToken is not a valid MemberRef , MethodDef , TypeSpec , signature, or FieldDef token in the scope of the current module. |
T:System.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
|
virtual |
Returns the string identified by the specified metadata token.
metadataToken | A metadata token that identifies a string in the string heap of the module. |
T:System.ArgumentException | metadataToken is not a token for a string in the scope of the current module. |
T:System.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
Type System.Reflection.Module.ResolveType | ( | int | metadataToken | ) |
Returns the type identified by the specified metadata token.
metadataToken | A metadata token that identifies a type in the module. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
|
virtual |
Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters.
metadataToken | A metadata token that identifies a type in the module. |
genericTypeArguments | An 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. |
genericMethodArguments | An 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. |
T:System.ArgumentException | metadataToken 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.ArgumentOutOfRangeException | metadataToken is not a valid token in the scope of the current module. |
Reimplemented in System.Reflection.Emit.ModuleBuilder.
override string System.Reflection.Module.ToString | ( | ) |
|
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.
|
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.
ModuleHandle System.Reflection.Module.ModuleHandle => GetModuleHandle() |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |