Class ReflectionProvider
Base class for reflection provider implementations.
Implements
Namespace: System.Reflection
Assembly: Nuqleon.Reflection.Virtualization.dll
Syntax
public abstract class ReflectionProvider : Object, IReflectionProvider, IReflectionIntrospectionProvider, IAssemblyIntrospectionProvider, IModuleIntrospectionProvider, ITypeIntrospectionProvider, IReflectionTypeSystemProvider, IFieldInfoIntrospectionProvider, IMethodInfoIntrospectionProvider, IMethodBaseIntrospectionProvider, IPropertyInfoIntrospectionProvider, IEventInfoIntrospectionProvider, IMemberInfoIntrospectionProvider, IParameterInfoIntrospectionProvider, IReflectionCreationProvider, ITypeCreationProvider, IMethodCreationProvider, IReflectionInvocationProvider, IReflectionLoadingProvider, IAssemblyLoadingProvider, IModuleLoadingProvider, ITypeLoadingProvider, IComTypeLoadingProvider, IReflectionHandlerResolver
Constructors
ReflectionProvider()
Declaration
protected ReflectionProvider()
Methods
AddEventHandler(EventInfo, Object, Delegate)
Adds an event handler to an event source.
Declaration
public abstract void AddEventHandler(EventInfo event, object target, Delegate handler)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to add a handler to. |
System.Object | target | The event source. |
System.Delegate | handler | Encapsulates a method or methods to be invoked when the event is raised by the target. |
AddModuleResolve(Assembly, ModuleResolveEventHandler)
Adds a module resolve handler.
Declaration
public abstract void AddModuleResolve(Assembly assembly, ModuleResolveEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to add a module resolve handler for. |
System.Reflection.ModuleResolveEventHandler | handler | The module resolve handler to add. |
Remarks
Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.
CanRead(PropertyInfo)
Gets a value indicating whether the property can be read.
Declaration
public abstract bool CanRead(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to check for readability. |
Returns
Type | Description |
---|---|
System.Boolean | true if this property can be read; otherwise, false. |
CanWrite(PropertyInfo)
Gets a value indicating whether the property can be written.
Declaration
public abstract bool CanWrite(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to check for writeable. |
Returns
Type | Description |
---|---|
System.Boolean | true if this property can be written; otherwise, false. |
ContainsGenericParameters(MethodBase)
Gets a value indicating whether the generic method contains unassigned generic type parameters.
Declaration
public abstract bool ContainsGenericParameters(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to check for generic parameters. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
ContainsGenericParameters(Type)
Gets a value indicating whether the specified type
object has type parameters that have not been replaced by specific types.
Declaration
public abstract bool ContainsGenericParameters(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check for generic parameters. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
CreateDelegate(MethodInfo, Type)
Creates a delegate that can be used to invoke the specified static method.
Declaration
public abstract Delegate CreateDelegate(MethodInfo method, Type delegateType)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to create a delegate for. |
System.Type | delegateType | The type of the delegate to create. |
Returns
Type | Description |
---|---|
System.Delegate | An instance of the specified delegate type that can be used to invoke the specified static method. |
CreateDelegate(MethodInfo, Type, Object)
Creates a delegate that can be used to invoke the specified instance method on the specified target object.
Declaration
public abstract Delegate CreateDelegate(MethodInfo method, Type delegateType, object target)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to create a delegate for. |
System.Type | delegateType | The type of the delegate to create. |
System.Object | target | The target object to invoke the method on. |
Returns
Type | Description |
---|---|
System.Delegate | An instance of the specified delegate type that can be used to invoke the specified instance method on the specified target object. |
CreateInstance(Assembly, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])
Locates the specified type from specified assembly
and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes.
Declaration
public abstract object CreateInstance(Assembly assembly, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly containing the type to instantiate. |
System.String | typeName | The System.Type.FullName of the type to locate. |
System.Boolean | ignoreCase | true to ignore the case of the type name; otherwise, false. |
System.Reflection.BindingFlags | bindingAttr | A bitmask that affects the way in which the search is conducted. The value is a combination of bit flags from System.Reflection.BindingFlags. |
System.Reflection.Binder | binder | An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If |
System.Object[] | args | An array that contains the arguments to be passed to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to be invoked. If the default constructor is desired, |
System.Globalization.CultureInfo | culture | An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.) |
System.Object[] | activationAttributes | An array of one or more attributes that can participate in activation. Typically, an array that contains a single |
Returns
Type | Description |
---|---|
System.Object | An instance of the specified type, or null if |
FindInterfaces(Type, TypeFilter, Object)
Returns an array of System.Type objects representing a filtered list of interfaces implemented or inherited by the specified type
.
Declaration
public abstract IReadOnlyList<Type> FindInterfaces(Type type, TypeFilter filter, object filterCriteria)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to find interfaces for. |
System.Reflection.TypeFilter | filter | The delegate that compares the interfaces against |
System.Object | filterCriteria | The search criteria that determines whether an interface should be included in the returned array. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects representing a filtered list of the interfaces implemented or inherited by the specified |
FindMembers(Type, MemberTypes, BindingFlags, MemberFilter, Object)
Returns a filtered array of System.Reflection.MemberInfo objects of the specified member type.
Declaration
public abstract IReadOnlyList<MemberInfo> FindMembers(Type type, MemberTypes memberType, BindingFlags bindingAttr, MemberFilter filter, object filterCriteria)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to find members in. |
System.Reflection.MemberTypes | memberType | An object that indicates the type of member to search for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.-or- Zero, to return null. |
System.Reflection.MemberFilter | filter | The delegate that does the comparisons, returning true if the member currently being inspected matches the |
System.Object | filterCriteria | The search criteria that determines whether a member is returned in the array of MemberInfo objects.The fields of FieldAttributes, MethodAttributes, and MethodImplAttributes can be used in conjunction with the FilterAttribute delegate supplied by this class. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MemberInfo> | A filtered array of System.Reflection.MemberInfo objects of the specified member type.-or- An empty array of type System.Reflection.MemberInfo, if the specified |
FindTypes(Module, TypeFilter, Object)
Returns an array of classes accepted by the given filter and filter criteria.
Declaration
public abstract IReadOnlyList<Type> FindTypes(Module module, TypeFilter filter, object filterCriteria)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to find types in. |
System.Reflection.TypeFilter | filter | The delegate used to filter the classes. |
System.Object | filterCriteria | An Object used to filter the classes. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of type System.Type containing classes that were accepted by the filter. |
GetAccessors(PropertyInfo, Boolean)
Returns an array whose elements reflect the public and, if specified, non-public get, set, and other accessors of the specified property.
Declaration
public abstract IReadOnlyList<MethodInfo> GetAccessors(PropertyInfo property, bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the accessors for. |
System.Boolean | nonPublic | true if non-public methods can be returned; otherwise, false. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MethodInfo> | An array of System.Reflection.MethodInfo objects whose elements reflect the get, set, and other accessors of the specified property. If |
GetAddMethod(EventInfo, Boolean)
Retrieves the System.Reflection.MethodInfo object for the System.Reflection.EventInfo.AddEventHandler(System.Object,System.Delegate) method of the event, specifying whether to return non-public methods.
Declaration
public abstract MethodInfo GetAddMethod(EventInfo event, bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to get the add method for. |
System.Boolean | nonPublic | true if non-public methods can be returned; otherwise, false. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A System.Reflection.MethodInfo object representing the method used to add an event handler delegate from the event source. |
GetArrayRank(Type)
Gets the number of dimensions in an System.Array.
Declaration
public abstract int GetArrayRank(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the rank for. |
Returns
Type | Description |
---|---|
System.Int32 | An System.Int32 containing the number of dimensions in the specified |
GetAssembly(Module)
Gets the appropriate System.Reflection.Assembly for the specified module
.
Declaration
public abstract Assembly GetAssembly(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the assembly for. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | An System.Reflection.Assembly object. |
GetAssembly(Type)
Gets the System.Reflection.Assembly in which the specified type
is declared. For generic types, gets the System.Reflection.Assembly in which the generic type is defined.
Declaration
public abstract Assembly GetAssembly(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the declaring assembly for. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | An System.Reflection.Assembly instance that describes the assembly containing the specified |
GetAssemblyQualifiedName(Type)
Gets the assembly-qualified name of the specified type
, which includes the name of the assembly from which the specified type
was loaded.
Declaration
public abstract string GetAssemblyQualifiedName(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the assembly-qualified name for. |
Returns
Type | Description |
---|---|
System.String | The assembly-qualified name of the specified |
GetAttributes(EventInfo)
Gets the attributes associated with the specified event.
Declaration
public abstract EventAttributes GetAttributes(EventInfo event)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to get the attributes for. |
Returns
Type | Description |
---|---|
System.Reflection.EventAttributes | The attributes associated with the specified event. |
GetAttributes(FieldInfo)
Gets the attributes associated with the specified field.
Declaration
public abstract FieldAttributes GetAttributes(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to get the attributes for. |
Returns
Type | Description |
---|---|
System.Reflection.FieldAttributes | The attributes associated with the specified field. |
GetAttributes(MethodBase)
Gets the attributes associated with the specified method.
Declaration
public abstract MethodAttributes GetAttributes(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The property to get the method for. |
Returns
Type | Description |
---|---|
System.Reflection.MethodAttributes | The attributes associated with the specified method. |
GetAttributes(ParameterInfo)
Gets the attributes for the specified parameter.
Declaration
public abstract ParameterAttributes GetAttributes(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the attributes for. |
Returns
Type | Description |
---|---|
System.Reflection.ParameterAttributes | A System.Reflection.ParameterAttributes object representing the attributes for this parameter. |
GetAttributes(PropertyInfo)
Gets the attributes associated with the specified property.
Declaration
public abstract PropertyAttributes GetAttributes(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the attributes for. |
Returns
Type | Description |
---|---|
System.Reflection.PropertyAttributes | The attributes associated with the specified property. |
GetAttributes(Type)
Gets the attributes associated with the specified type
.
Declaration
public abstract TypeAttributes GetAttributes(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the attributes for. |
Returns
Type | Description |
---|---|
System.Reflection.TypeAttributes | A System.Reflection.TypeAttributes object representing the attribute set of the specified |
GetBaseDefinition(MethodInfo)
Returns the System.Reflection.MethodInfo object for the method on the direct or indirect base class in which the method represented by this instance was first declared.
Declaration
public abstract MethodInfo GetBaseDefinition(MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to get the base definition for. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A System.Reflection.MethodInfo object for the first implementation of this method. |
GetBaseType(Type)
Gets the type from which the specified type
directly inherits.
Declaration
public abstract Type GetBaseType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the base type for. |
Returns
Type | Description |
---|---|
System.Type | The System.Type from which the specified |
GetCallingConvention(MethodBase)
Gets the calling convention of the specified method.
Declaration
public abstract CallingConventions GetCallingConvention(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to get the calling convention for. |
Returns
Type | Description |
---|---|
System.Reflection.CallingConventions | The calling convention of the specified method. |
GetConstantValue(PropertyInfo)
Returns a literal value associated with the property by a compiler.
Declaration
public abstract object GetConstantValue(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property for which to get the literal value. |
Returns
Type | Description |
---|---|
System.Object | An object that contains the literal value associated with the property. If the literal value is a class type with an element value of zero, the return value is null. |
GetConstructor(Type, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.
Declaration
public abstract ConstructorInfo GetConstructor(Type type, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the constructor for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
System.Reflection.Binder | binder | An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference, to use the System.Type.DefaultBinder. |
System.Reflection.CallingConventions | callConvention | The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and the stack is cleaned up. |
System.Type[] | types | An array of System.Type objects representing the number, order, and type of the parameters for the constructor to get.-or- An empty array of the type System.Type to get a constructor that takes no parameters. |
System.Reflection.ParameterModifier[] | modifiers | An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the |
Returns
Type | Description |
---|---|
System.Reflection.ConstructorInfo | An object representing the constructor that matches the specified requirements, if found; otherwise, null. |
GetConstructors(Type, BindingFlags)
Searches for the constructors defined for the specified type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<ConstructorInfo> GetConstructors(Type type, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the constructors for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.ConstructorInfo> | An array of System.Reflection.ConstructorInfo objects representing all constructors defined for the specified type that match the specified binding constraints.-or- An empty array of type System.Reflection.ConstructorInfo, if no constructors are defined for the specified type, or if none of the defined constructors match the binding constraints. |
GetCustomAttributes(Assembly, Boolean)
Gets all the custom attributes for the specified assembly
.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(Assembly assembly, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get custom attributes for. |
System.Boolean | inherit | This argument is ignored for objects of type System.Reflection.Assembly. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array that contains the custom attributes for the specified |
GetCustomAttributes(Assembly, Type, Boolean)
Gets the custom attributes for the specified assembly
as specified by type.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(Assembly assembly, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get custom attributes for. |
System.Type | attributeType | The type for which the custom attributes are to be returned. |
System.Boolean | inherit | This argument is ignored for objects of type System.Reflection.Assembly. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array that contains the custom attributes for the specified |
GetCustomAttributes(MemberInfo, Boolean)
Returns an array of all custom attributes applied to the specified member.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(MemberInfo member, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to get the custom attributes for. |
System.Boolean | inherit | true to search the specified member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array that contains all the custom attributes applied to the specified member, or an array with zero elements if no attributes are defined. |
GetCustomAttributes(MemberInfo, Type, Boolean)
Returns an array of custom attributes applied to the specified member and identified by the specified attributeType
.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(MemberInfo member, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to get the custom attributes for. |
System.Type | attributeType | The type of attribute to search for. Only attributes that are assignable to this type are returned. |
System.Boolean | inherit | true to search the specified member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array of custom attributes applied to the specified member, or an array with zero elements if no attributes assignable to |
GetCustomAttributes(Module, Boolean)
Gets all the custom attributes for the specified module
.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(Module module, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get custom attributes for. |
System.Boolean | inherit | This argument is ignored for objects of type System.Reflection.Module. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array that contains the custom attributes for the specified |
GetCustomAttributes(Module, Type, Boolean)
Gets the custom attributes for the specified module
as specified by type.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(Module module, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get custom attributes for. |
System.Type | attributeType | The type for which the custom attributes are to be returned. |
System.Boolean | inherit | This argument is ignored for objects of type System.Reflection.Module. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array that contains the custom attributes for the specified |
GetCustomAttributes(ParameterInfo, Boolean)
Returns an array of all custom attributes applied to the specified parameter.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(ParameterInfo parameter, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the custom attributes for. |
System.Boolean | inherit | true to search the specified parameter's inheritance chain to find the attributes; otherwise, false. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array that contains all the custom attributes applied to the specified parameter, or an array with zero elements if no attributes are defined. |
GetCustomAttributes(ParameterInfo, Type, Boolean)
Returns an array of custom attributes applied to the specified parameter and identified by the specified attributeType
.
Declaration
public abstract IReadOnlyList<object> GetCustomAttributes(ParameterInfo parameter, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the custom attributes for. |
System.Type | attributeType | The type of attribute to search for. Only attributes that are assignable to this type are returned. |
System.Boolean | inherit | true to search the specified parameter's inheritance chain to find the attributes; otherwise, false. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> | An array of custom attributes applied to the specified parameter, or an array with zero elements if no attributes assignable to |
GetCustomAttributesData(Assembly)
Returns information about the attributes that have been applied to the specified assembly
, expressed as System.Reflection.CustomAttributeData objects.
Declaration
public abstract IEnumerable<CustomAttributeData> GetCustomAttributesData(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get custom attributes data for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> | A generic list of System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the specified |
GetCustomAttributesData(MemberInfo)
Gets the custom attributes data defined on the specified member.
Declaration
public abstract IEnumerable<CustomAttributeData> GetCustomAttributesData(MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to get the custom attributes data for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> | The custom attributes data for the specified member. |
GetCustomAttributesData(Module)
Returns information about the attributes that have been applied to the specified module
, expressed as System.Reflection.CustomAttributeData objects.
Declaration
public abstract IEnumerable<CustomAttributeData> GetCustomAttributesData(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get custom attributes data for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> | A generic list of System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the specified |
GetCustomAttributesData(ParameterInfo)
Gets the custom attributes data defined on the specified parameter.
Declaration
public abstract IEnumerable<CustomAttributeData> GetCustomAttributesData(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The member to get the custom attributes data for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> | The custom attributes data for the specified parameter. |
GetDeclaringMethod(Type)
Gets a System.Reflection.MethodBase that represents the declaring method, if the specified type
represents a type parameter of a generic method.
Declaration
public abstract MethodBase GetDeclaringMethod(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the declaring method for. |
Returns
Type | Description |
---|---|
System.Reflection.MethodBase | If the specified |
GetDeclaringType(MemberInfo)
Gets the declaring type of the specified member.
Declaration
public abstract Type GetDeclaringType(MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to get the declaring type for. |
Returns
Type | Description |
---|---|
System.Type | The declaring type of the specified member. |
GetDeclaringType(Type)
Gets the type that declares the current nested type or generic type parameter.
Declaration
public abstract Type GetDeclaringType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the declaring type for. |
Returns
Type | Description |
---|---|
System.Type | A System.Type object representing the enclosing type, if the specified |
GetDefaultMembers(Type)
Searches for the members defined for the specified type
whose System.Reflection.DefaultMemberAttribute is set.
Declaration
public abstract IReadOnlyList<MemberInfo> GetDefaultMembers(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the default members for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MemberInfo> | An array of System.Reflection.MemberInfo objects representing all default members of the specified |
GetDefaultValue(ParameterInfo)
Gets a value indicating the default value if the parameter has a default value.
Declaration
public abstract object GetDefaultValue(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the default value for. |
Returns
Type | Description |
---|---|
System.Object | The default value of the parameter, or System.DBNull.Value if the parameter has no default value. |
GetDefinedTypes(Assembly)
Gets the types defined in the specified assembly
.
Declaration
public abstract IEnumerable<TypeInfo> GetDefinedTypes(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to search in. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo> | An array of types defined in the specified |
GetElementType(Type)
Gets the element type of an array, by-ref, or pointer type.
Declaration
public abstract Type GetElementType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the element type for. |
Returns
Type | Description |
---|---|
System.Type | The element type of the specified type. |
GetEntryPoint(Assembly)
Gets the entry point of this assembly.
Declaration
public abstract MethodInfo GetEntryPoint(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the entry point for. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | An object that represents the entry point of this assembly. If no entry point is found (for example, the assembly is a DLL), null is returned. |
GetEvent(Type, String, BindingFlags)
Searches for an event with the specified name, using the specified binding constraints.
Declaration
public abstract EventInfo GetEvent(Type type, string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the event for. |
System.String | name | The name of the event to search for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Reflection.EventInfo | An object representing the event that matches the specified requirements, if found; otherwise, null. |
GetEventHandlerType(EventInfo)
Gets the type of the event handler.
Declaration
public abstract Type GetEventHandlerType(EventInfo event)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to get the event handler type for. |
Returns
Type | Description |
---|---|
System.Type | The type of the event handler. |
GetEvents(Type, BindingFlags)
Searches for events that are declared or inherited by the specified type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<EventInfo> GetEvents(Type type, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the events for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.EventInfo> | An array of System.Reflection.EventInfo objects representing all events defined for the specified type that match the specified binding constraints.-or- An empty array of type System.Reflection.EventInfo, if no events are defined for the specified type, or if none of the defined events match the binding constraints. |
GetExportedTypes(Assembly)
Gets the public types defined in the specified assembly
that are visible outside the specified assembly
.
Declaration
public abstract IReadOnlyList<Type> GetExportedTypes(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get exported types from. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array that represents the types defined in this assembly that are visible outside the assembly. |
GetField(Module, String, BindingFlags)
Returns a field having the specified name and binding attributes.
Declaration
public abstract FieldInfo GetField(Module module, string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to search in. |
System.String | name | The field name. |
System.Reflection.BindingFlags | bindingAttr | One of the System.Reflection.BindingFlags bit flags used to control the search. |
Returns
Type | Description |
---|---|
System.Reflection.FieldInfo | A System.Reflection.FieldInfo object having the specified name and binding attributes, or null if the field does not exist. |
GetField(Type, String, BindingFlags)
Searches for a field with the specified name, using the specified binding constraints.
Declaration
public abstract FieldInfo GetField(Type type, string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the field for. |
System.String | name | The name of the field to search for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Reflection.FieldInfo | An object representing the field that matches the specified requirements, if found; otherwise, null. |
GetFieldFromHandle(RuntimeFieldHandle)
Gets a System.Reflection.FieldInfo for the field represented by the specified handle.
Declaration
public abstract FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle)
Parameters
Type | Name | Description |
---|---|---|
System.RuntimeFieldHandle | handle | A System.RuntimeFieldHandle structure that contains the handle to the internal metadata representation of a field. |
Returns
Type | Description |
---|---|
System.Reflection.FieldInfo | A System.Reflection.FieldInfo object representing the field specified by |
GetFieldFromHandle(RuntimeFieldHandle, RuntimeTypeHandle)
Gets a System.Reflection.FieldInfo for the field represented by the specified handle, for the specified generic type.
Declaration
public abstract FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle, RuntimeTypeHandle declaringType)
Parameters
Type | Name | Description |
---|---|---|
System.RuntimeFieldHandle | handle | A System.RuntimeFieldHandle structure that contains the handle to the internal metadata representation of a field. |
System.RuntimeTypeHandle | declaringType | A System.RuntimeTypeHandle structure that contains the handle to the generic type that defines the field. |
Returns
Type | Description |
---|---|
System.Reflection.FieldInfo | A System.Reflection.FieldInfo object representing the field specified by |
GetFieldHandle(FieldInfo)
Gets a System.RuntimeFieldHandle, which is a handle to the internal metadata representation of a field.
Declaration
public abstract RuntimeFieldHandle GetFieldHandle(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to get the runtime handle for. |
Returns
Type | Description |
---|---|
System.RuntimeFieldHandle | A handle to the internal metadata representation of a field. |
GetFields(Module, BindingFlags)
Returns the global fields defined on the module that match the specified binding flags.
Declaration
public abstract IReadOnlyList<FieldInfo> GetFields(Module module, BindingFlags bindingFlags)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to search in. |
System.Reflection.BindingFlags | bindingFlags | A bitwise combination of System.Reflection.BindingFlags values that limit the search. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.FieldInfo> | An array of type 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. |
GetFields(Type, BindingFlags)
Searches for fields defined for the specified type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<FieldInfo> GetFields(Type type, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the fields for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.FieldInfo> | An array of System.Reflection.FieldInfo objects representing all fields defined for the specified type that match the specified binding constraints.-or- An empty array of type System.Reflection.FieldInfo, if no fields are defined for the specified type, or if none of the defined fields match the binding constraints. |
GetFieldType(FieldInfo)
Gets the type of the field.
Declaration
public abstract Type GetFieldType(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to get the type for. |
Returns
Type | Description |
---|---|
System.Type | The type of the field. |
GetFile(Assembly, String)
Gets a System.IO.FileStream for the specified file in the file table of the manifest of the specified assembly
.
Declaration
public abstract FileStream GetFile(Assembly assembly, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the file from. |
System.String | name | The name of the specified file. Do not include the path to the file. |
Returns
Type | Description |
---|---|
System.IO.FileStream | A stream that contains the specified file, or null if the file is not found. |
GetFiles(Assembly, Boolean)
Gets the files in the file table of an assembly manifest, specifying whether to include resource modules.
Declaration
public abstract IReadOnlyList<FileStream> GetFiles(Assembly assembly, bool getResourceModules)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the files from. |
System.Boolean | getResourceModules | true to include resource modules; otherwise, false. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.IO.FileStream> | An array of streams that contain the files. |
GetFullName(Assembly)
Gets the display name of the assembly.
Declaration
public abstract string GetFullName(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the display name for. |
Returns
Type | Description |
---|---|
System.String | The display name of the assembly. |
GetFullName(Type)
Gets the fully qualified name of the specified type
, including the namespace of the System.Type but not the assembly.
Declaration
public abstract string GetFullName(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the full name for. |
Returns
Type | Description |
---|---|
System.String | The fully qualified name of the specified |
GetFullyQualifiedName(Module)
Gets a string representing the fully qualified name and path to the specified module
.
Declaration
public abstract string GetFullyQualifiedName(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the fully qualified name for. |
Returns
Type | Description |
---|---|
System.String | The fully qualified module name. |
GetGenericArguments(MethodInfo)
Returns an array of System.Type objects that represent the type arguments of a closed generic method or the type parameters of a generic method definition.
Declaration
public abstract IReadOnlyList<Type> GetGenericArguments(MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to get the generic arguments for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that represent the type arguments of a generic method. Returns an empty array if the specified method is not a generic method. |
GetGenericArguments(Type)
Returns an array of System.Type objects that represent the type arguments of a closed generic type or the type parameters of a generic type definition.
Declaration
public abstract IReadOnlyList<Type> GetGenericArguments(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the generic arguments for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that represent the type arguments of a generic type. Returns an empty array if the specified type is not a generic type. |
GetGenericMethodDefinition(MethodInfo)
Gets the generic method definition of the specified generic method.
Declaration
public abstract MethodInfo GetGenericMethodDefinition(MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to get the generic method definition for. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | The generic method definition of the specified method. |
GetGenericParameterAttributes(Type)
Gets a combination of System.Reflection.GenericParameterAttributes flags that describe the covariance and special constraints of the specified generic type parameter.
Declaration
public abstract GenericParameterAttributes GetGenericParameterAttributes(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the generic parameter attributes for. |
Returns
Type | Description |
---|---|
System.Reflection.GenericParameterAttributes | A bitwise combination of System.Reflection.GenericParameterAttributes values that describes the covariance and special constraints of the specified generic type parameter. |
GetGenericParameterConstraints(Type)
Returns an array of System.Type objects that represent the constraints on the generic type parameter.
Declaration
public abstract IReadOnlyList<Type> GetGenericParameterConstraints(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The generic parameter type to get the constraints for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that represent the constraints on the specified generic type parameter. |
GetGenericParameterPosition(Type)
Gets the position of the type parameter in the type parameter list of the generic type or method that declared the parameter, when the specified type
represents a type parameter of a generic type or a generic method.
Declaration
public abstract int GetGenericParameterPosition(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the generic parameter position for. |
Returns
Type | Description |
---|---|
System.Int32 | The position of a type parameter in the type parameter list of the generic type or method that defines the parameter. Position numbers begin at 0. |
GetGenericTypeDefinition(Type)
Gets the generic type definition of the specified generic type.
Declaration
public abstract Type GetGenericTypeDefinition(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the generic type definition for. |
Returns
Type | Description |
---|---|
System.Type | The generic type definition of the specified type. |
GetGetMethod(PropertyInfo, Boolean)
Returns the public or non-public get accessor for this property.
Declaration
public abstract MethodInfo GetGetMethod(PropertyInfo property, bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the get accessor for. |
System.Boolean | nonPublic | true if non-public methods can be returned; otherwise, false. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A System.Reflection.MethodInfo object representing the get accessor for this property, if |
GetGuid(Type)
Gets the GUID associated with the specified type
.
Declaration
public abstract Guid GetGuid(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the associated GUID for. |
Returns
Type | Description |
---|---|
System.Guid | The GUID associated with the specified |
GetHostContext(Assembly)
Gets the host context with which the assembly was loaded.
Declaration
public abstract long GetHostContext(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the host context for. |
Returns
Type | Description |
---|---|
System.Int64 | An System.Int64 value that indicates the host context with which the assembly was loaded, if any. |
GetImageRuntimeVersion(Assembly)
Gets a string representing the version of the common language runtime (CLR) saved in the file containing the manifest.
Declaration
public abstract string GetImageRuntimeVersion(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the runtime version for. |
Returns
Type | Description |
---|---|
System.String | The CLR version folder name. This is not a full path. |
GetIndexParameters(PropertyInfo)
Returns an array of all the index parameters for the property.
Declaration
public abstract IReadOnlyList<ParameterInfo> GetIndexParameters(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the index parameters for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.ParameterInfo> | An array of type System.Reflection.ParameterInfo containing the parameters for the indexes. If the property is not indexed, the array has 0 (zero) elements. |
GetInterface(Type, String, Boolean)
Searches for the specified interface, specifying whether to do a case-insensitive search for the interface name.
Declaration
public abstract Type GetInterface(Type type, string name, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the interface for. |
System.String | name | The string containing the name of the interface to get. For generic interfaces, this is the mangled name. |
System.Boolean | ignoreCase | true to ignore the case of that part of |
Returns
Type | Description |
---|---|
System.Type | An object representing the interface with the specified name, implemented or inherited by the specified type, if found; otherwise, null. |
GetInterfaceMap(Type, Type)
Returns an interface mapping for the specified interface type.
Declaration
public abstract InterfaceMapping GetInterfaceMap(Type type, Type interfaceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the interface mapping for. |
System.Type | interfaceType | The interface type to retrieve a mapping for. |
Returns
Type | Description |
---|---|
System.Reflection.InterfaceMapping | An object that represents the interface mapping for |
GetInterfaces(Type)
Gets all the interfaces implemented or inherited by the specified type.
Declaration
public abstract IReadOnlyList<Type> GetInterfaces(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the interfaces for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects representing all the interfaces implemented or inherited by the specified type.-or- An empty array of type System.Type, if no interfaces are implemented or inherited by the specified type. |
GetLoadedModules(Assembly, Boolean)
Gets all the loaded modules that are part of the specified assembly
, specifying whether to include resource modules.
Declaration
public abstract IReadOnlyList<Module> GetLoadedModules(Assembly assembly, bool getResourceModules)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the loaded modules for. |
System.Boolean | getResourceModules | true to include resource modules; otherwise, false. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.Module> | An array of modules. |
GetLocation(Assembly)
Gets the path or UNC location of the loaded file that contains the manifest.
Declaration
public abstract string GetLocation(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the location for. |
Returns
Type | Description |
---|---|
System.String | The location of the loaded file that contains the manifest. If the loaded file was shadow-copied, the location is that of the file after being shadow-copied. If the assembly is loaded from a byte array, such as when using the System.Reflection.Assembly.Load(System.Byte[]) method overload, the value returned is an empty string (""). |
GetManifestModule(Assembly)
Gets the module that contains the manifest for the current assembly.
Declaration
public abstract Module GetManifestModule(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the manifest module for. |
Returns
Type | Description |
---|---|
System.Reflection.Module | The module that contains the manifest for the assembly. |
GetManifestResourceInfo(Assembly, String)
Returns information about how the given resource has been persisted.
Declaration
public abstract ManifestResourceInfo GetManifestResourceInfo(Assembly assembly, string resourceName)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the manifest resource info from. |
System.String | resourceName | The case-sensitive name of the resource. |
Returns
Type | Description |
---|---|
System.Reflection.ManifestResourceInfo | An object that is populated with information about the resource's topology, or null if the resource is not found. |
GetManifestResourceNames(Assembly)
Returns the names of all the resources in the specified assembly
.
Declaration
public abstract IReadOnlyList<string> GetManifestResourceNames(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the manifest resource names from. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.String> | An array that contains the names of all the resources. |
GetManifestResourceStream(Assembly, String)
Loads the specified manifest resource from the specified assembly
.
Declaration
public abstract Stream GetManifestResourceStream(Assembly assembly, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the manifest resource stream from. |
System.String | name | The case-sensitive name of the manifest resource being requested. |
Returns
Type | Description |
---|---|
System.IO.Stream | The manifest resource; or null if no resources were specified during compilation or if the resource is not visible to the caller. |
GetManifestResourceStream(Assembly, Type, String)
Loads the specified manifest resource, scoped by the namespace of the specified type, from the specified assembly
.
Declaration
public abstract Stream GetManifestResourceStream(Assembly assembly, Type type, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the manifest resource stream from. |
System.Type | type | The type whose namespace is used to scope the manifest resource name. |
System.String | name | The case-sensitive name of the manifest resource being requested. |
Returns
Type | Description |
---|---|
System.IO.Stream | The manifest resource; or null if no resources were specified during compilation or if the resource is not visible to the caller. |
GetMDStreamVersion(Module)
Gets the metadata stream version.
Declaration
public abstract int GetMDStreamVersion(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the metadata stream version for. |
Returns
Type | Description |
---|---|
System.Int32 | 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. |
GetMember(ParameterInfo)
Gets a value indicating the member in which the parameter is implemented.
Declaration
public abstract MemberInfo GetMember(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the member for. |
Returns
Type | Description |
---|---|
System.Reflection.MemberInfo | The member which implanted the parameter represented by |
GetMember(Type, String, MemberTypes, BindingFlags)
Searches for the specified members of the specified member type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<MemberInfo> GetMember(Type type, string name, MemberTypes memberTypes, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the members for. |
System.String | name | The string containing the name of the members to get. |
System.Reflection.MemberTypes | memberTypes | The types of members to search for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MemberInfo> | An array of System.Reflection.MemberInfo objects representing the members with the specified name, if found; otherwise, an empty array. |
GetMembers(Type, BindingFlags)
Searches for members defined for the specified type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<MemberInfo> GetMembers(Type type, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the members for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MemberInfo> | An array of System.Reflection.MemberInfo objects representing all members defined for the specified type that match the specified binding constraints.-or- An empty array of type System.Reflection.MemberInfo, if no members are defined for the specified type, or if none of the defined members match the binding constraints. |
GetMetadataToken(MemberInfo)
Gets a value that identifies a metadata element.
Declaration
public abstract int GetMetadataToken(MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to get the metadata token for. |
Returns
Type | Description |
---|---|
System.Int32 | A value which, in combination with System.Reflection.MemberInfo.Module, uniquely identifies a metadata element. |
GetMetadataToken(Module)
Gets a token that identifies the module in metadata.
Declaration
public abstract int GetMetadataToken(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the metadata token for. |
Returns
Type | Description |
---|---|
System.Int32 | An integer token that identifies the current module in metadata. |
GetMetadataToken(ParameterInfo)
Gets a value that identifies this parameter in metadata.
Declaration
public abstract int GetMetadataToken(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the metadata token for. |
Returns
Type | Description |
---|---|
System.Int32 | A value which, in combination with the module, uniquely identifies this parameter in metadata. |
GetMethod(Module, String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
Returns the method implementation in accordance with the specified criteria.
Declaration
public abstract MethodInfo GetMethod(Module module, string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to search in. |
System.String | name | The method name. |
System.Reflection.BindingFlags | bindingAttr | One of the BindingFlags bit flags used to control the search. |
System.Reflection.Binder | binder | An object that implements Binder, containing properties related to this method. |
System.Reflection.CallingConventions | callConvention | The calling convention for the method. |
System.Type[] | types | The parameter types to search for. |
System.Reflection.ParameterModifier[] | modifiers | An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A System.Reflection.MethodInfo object containing implementation information as specified, or null if the method does not exist. |
GetMethod(Type, String, Int32, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
Searches for the specified method whose parameters match the specified generic parameter count, argument types and modifiers, using the specified binding constraints and the specified calling convention.
Declaration
public abstract MethodInfo GetMethod(Type type, string name, int genericParameterCount, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the method for. |
System.String | name | The string containing the name of the method to get. |
System.Int32 | genericParameterCount | The number of generic type parameters of the method. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
System.Reflection.Binder | binder | An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference, to use the System.Type.DefaultBinder. |
System.Reflection.CallingConventions | callConvention | The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and the stack is cleaned up. |
System.Type[] | types | An array of System.Type objects representing the number, order, and type of the parameters for the method to get.-or- An empty array of the type System.Type to get a method that takes no parameters. |
System.Reflection.ParameterModifier[] | modifiers | An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | An object representing the method that matches the specified requirements, if found; otherwise, null. |
GetMethod(Type, String, BindingFlags)
Searches for the specified method, using the specified binding constraints.
Declaration
public abstract MethodInfo GetMethod(Type type, string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the method for. |
System.String | name | The string containing the name of the method to get. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | An object representing the method that matches the specified requirements, if found; otherwise, null. |
GetMethod(Type, String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
Searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.
Declaration
public abstract MethodInfo GetMethod(Type type, string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the method for. |
System.String | name | The string containing the name of the method to get. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
System.Reflection.Binder | binder | An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference, to use the System.Type.DefaultBinder. |
System.Reflection.CallingConventions | callConvention | The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and the stack is cleaned up. |
System.Type[] | types | An array of System.Type objects representing the number, order, and type of the parameters for the method to get.-or- An empty array of the type System.Type to get a method that takes no parameters. |
System.Reflection.ParameterModifier[] | modifiers | An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | An object representing the method that matches the specified requirements, if found; otherwise, null. |
GetMethodBody(MethodBase)
Gets the method body of the specified method.
Declaration
public abstract MethodBody GetMethodBody(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to get the method body for. |
Returns
Type | Description |
---|---|
System.Reflection.MethodBody | The method body of the specified method. |
GetMethodFromHandle(RuntimeMethodHandle)
Gets method information by using the method's internal metadata representation (handle).
Declaration
public abstract MethodBase GetMethodFromHandle(RuntimeMethodHandle handle)
Parameters
Type | Name | Description |
---|---|---|
System.RuntimeMethodHandle | handle | The method's handle. |
Returns
Type | Description |
---|---|
System.Reflection.MethodBase | A System.Reflection.MethodBase containing information about the method. |
GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle)
Gets a System.Reflection.MethodBase object for the constructor or method represented by the specified handle, for the specified generic type.
Declaration
public abstract MethodBase GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType)
Parameters
Type | Name | Description |
---|---|---|
System.RuntimeMethodHandle | handle | A handle to the internal metadata representation of a constructor or method. |
System.RuntimeTypeHandle | declaringType | A handle to the generic type that defines the constructor or method. |
Returns
Type | Description |
---|---|
System.Reflection.MethodBase | A System.Reflection.MethodBase object representing the method or constructor specified by |
GetMethodHandle(MethodBase)
Gets a handle to the internal metadata representation of the specified method.
Declaration
public abstract RuntimeMethodHandle GetMethodHandle(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to get a method handle for. |
Returns
Type | Description |
---|---|
System.RuntimeMethodHandle | A System.RuntimeMethodHandle object. |
GetMethodImplementationFlags(MethodBase)
Returns the System.Reflection.MethodImplAttributes flags of the specified method.
Declaration
public abstract MethodImplAttributes GetMethodImplementationFlags(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to get the implementation flags for. |
Returns
Type | Description |
---|---|
System.Reflection.MethodImplAttributes | The System.Reflection.MethodImplAttributes flags. |
GetMethods(Module, BindingFlags)
Returns the global methods defined on the module that match the specified binding flags.
Declaration
public abstract IReadOnlyList<MethodInfo> GetMethods(Module module, BindingFlags bindingFlags)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to search in. |
System.Reflection.BindingFlags | bindingFlags | A bitwise combination of System.Reflection.BindingFlags values that limit the search. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MethodInfo> | An array of type 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. |
GetMethods(Type, BindingFlags)
Searches for methods defined for the specified type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<MethodInfo> GetMethods(Type type, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the methods for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MethodInfo> | An array of System.Reflection.MethodInfo objects representing all methods defined for the specified type that match the specified binding constraints.-or- An empty array of type System.Reflection.MethodInfo, if no methods are defined for the specified type, or if none of the defined methods match the binding constraints. |
GetModule(Assembly, String)
Gets the specified module in the specified assembly
.
Declaration
public abstract Module GetModule(Assembly assembly, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the module from. |
System.String | name | The name of the module being requested. |
Returns
Type | Description |
---|---|
System.Reflection.Module | The module being requested, or null if the module is not found. |
GetModule(MemberInfo)
Gets the module the member is defined in.
Declaration
public abstract Module GetModule(MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to get the module for. |
Returns
Type | Description |
---|---|
System.Reflection.Module | The module defining the member. |
GetModule(Type)
Gets the module in which the specified type
is defined.
Declaration
public abstract Module GetModule(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the module for. |
Returns
Type | Description |
---|---|
System.Reflection.Module | The module in which the specified |
GetModuleHandle(Module)
Gets a handle for the module.
Declaration
public abstract ModuleHandle GetModuleHandle(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the module handle for. |
Returns
Type | Description |
---|---|
System.ModuleHandle | A System.ModuleHandle structure for the current module. |
GetModules(Assembly, Boolean)
Gets all the modules that are part of the specified assembly
, specifying whether to include resource modules.
Declaration
public abstract IReadOnlyList<Module> GetModules(Assembly assembly, bool getResourceModules)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the modules for. |
System.Boolean | getResourceModules | true to include resource modules; otherwise, false. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.Module> | An array of modules. |
GetModuleVersionId(Module)
Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module.
Declaration
public abstract Guid GetModuleVersionId(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the module version for. |
Returns
Type | Description |
---|---|
System.Guid | A System.Guid that can be used to distinguish between two versions of a module. |
GetName(Assembly, Boolean)
Gets an System.Reflection.AssemblyName for the specified assembly
, setting the codebase as specified by copiedName
.
Declaration
public abstract AssemblyName GetName(Assembly assembly, bool copiedName)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the name for. |
System.Boolean | copiedName | true to set the System.Reflection.Assembly.CodeBase to the location of the assembly after it was shadow copied; false to set System.Reflection.Assembly.CodeBase to the original location. |
Returns
Type | Description |
---|---|
System.Reflection.AssemblyName | An object that contains the fully parsed display name for this assembly. |
GetName(MemberInfo)
Gets the name of the member.
Declaration
public abstract string GetName(MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to get the name for. |
Returns
Type | Description |
---|---|
System.String | The name of the member. |
GetName(Module)
Gets a String representing the name of the module with the path removed.
Declaration
public abstract string GetName(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the name for. |
Returns
Type | Description |
---|---|
System.String | The module name with no path. |
GetName(ParameterInfo)
Gets the name of the specified parameter.
Declaration
public abstract string GetName(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the name for. |
Returns
Type | Description |
---|---|
System.String | The name of the specified parameter. |
GetNamespace(Type)
Gets the namespace of the specified type
.
Declaration
public abstract string GetNamespace(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the namespace for. |
Returns
Type | Description |
---|---|
System.String | The namespace of the specified |
GetNestedType(Type, String, BindingFlags)
Searches for a nested type with the specified name, using the specified binding constraints.
Declaration
public abstract Type GetNestedType(Type type, string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the nested type for. |
System.String | name | The name of the nested type to search for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Type | An object representing the nested type that matches the specified requirements, if found; otherwise, null. |
GetNestedTypes(Type, BindingFlags)
Searches for types nested in the specified type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<Type> GetNestedTypes(Type type, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the nested types for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects representing all nested types defined for the specified type that match the specified binding constraints.-or- An empty array of type System.Type, if no nested types are defined for the specified type, or if none of the nested types methods match the binding constraints. |
GetOptionalCustomModifiers(FieldInfo)
Returns an array of types representing the optional custom modifiers of the field.
Declaration
public abstract IReadOnlyList<Type> GetOptionalCustomModifiers(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to get the modifiers for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that identify the optional custom modifiers of the specified |
GetOptionalCustomModifiers(ParameterInfo)
Returns an array of types representing the optional custom modifiers of the parameter.
Declaration
public abstract IReadOnlyList<Type> GetOptionalCustomModifiers(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the modifiers for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that identify the optional custom modifiers of the specified |
GetOptionalCustomModifiers(PropertyInfo)
Returns an array of types representing the optional custom modifiers of the property.
Declaration
public abstract IReadOnlyList<Type> GetOptionalCustomModifiers(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the modifiers for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that identify the optional custom modifiers of the |
GetOtherMethods(EventInfo, Boolean)
Returns the public methods that have been associated with an event in metadata using the .other directive.
Declaration
public abstract IReadOnlyList<MethodInfo> GetOtherMethods(EventInfo event, bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to get the associated methods for. |
System.Boolean | nonPublic | true if non-public methods can be returned; otherwise, false. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.MethodInfo> | An array of System.Reflection.MethodInfo objects representing the public methods that have been associated with the event in metadata by using the .other directive. If there are no such public methods, an empty array is returned. |
GetParameters(MethodBase)
Gets the parameters of the specified method or constructor.
Declaration
public abstract IReadOnlyList<ParameterInfo> GetParameters(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method or constructor to get the parameters for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.ParameterInfo> | An array of type System.Reflection.ParameterInfo containing information that matches the signature of the method (or constructor) of the specified System.Reflection.MethodBase instance. |
GetParameterType(ParameterInfo)
Gets the type of the specified parameter.
Declaration
public abstract Type GetParameterType(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the type for. |
Returns
Type | Description |
---|---|
System.Type | The type of the specified parameter. |
GetPEKind(Module, out PortableExecutableKinds, out ImageFileMachine)
Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module.
Declaration
public abstract void GetPEKind(Module module, out PortableExecutableKinds peKind, out ImageFileMachine machine)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the PE kind for. |
System.Reflection.PortableExecutableKinds | peKind | When this method returns, a combination of the System.Reflection.PortableExecutableKinds values indicating the nature of the code in the module. |
System.Reflection.ImageFileMachine | machine | When this method returns, one of the System.Reflection.ImageFileMachine values indicating the platform targeted by the module. |
GetPosition(ParameterInfo)
Gets the zero-based position of the parameter in the formal parameter list.
Declaration
public abstract int GetPosition(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the position for. |
Returns
Type | Description |
---|---|
System.Int32 | An integer representing the position the specified parameter occupies in the parameter list. |
GetProperties(Type, BindingFlags)
Searches for properties of for the specified type, using the specified binding constraints.
Declaration
public abstract IReadOnlyList<PropertyInfo> GetProperties(Type type, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the properties for. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.PropertyInfo> | An array of System.Reflection.PropertyInfo objects representing all properties defined for the specified type that match the specified binding constraints.-or- An empty array of type System.Reflection.PropertyInfo, if no properties are defined for the specified type, or if none of the defined properties match the binding constraints. |
GetProperty(Type, String, BindingFlags)
Searches for the specified property, using the specified binding constraints.
Declaration
public abstract PropertyInfo GetProperty(Type type, string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the property for. |
System.String | name | The string containing the name of the property to get. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
Returns
Type | Description |
---|---|
System.Reflection.PropertyInfo | An object representing the property that matches the specified requirements, if found; otherwise, null. |
GetProperty(Type, String, BindingFlags, Binder, Type, Type[], ParameterModifier[])
Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.
Declaration
public abstract PropertyInfo GetProperty(Type type, string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the property for. |
System.String | name | The string containing the name of the property to get. |
System.Reflection.BindingFlags | bindingAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. |
System.Reflection.Binder | binder | An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference, to use the System.Type.DefaultBinder. |
System.Type | returnType | The return type of the property. |
System.Type[] | types | An array of System.Type objects representing the number, order, and type of the parameters for the indexed property to get.-or- An empty array of the type System.Type to get a property that is not indexed. |
System.Reflection.ParameterModifier[] | modifiers | An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the |
Returns
Type | Description |
---|---|
System.Reflection.PropertyInfo | An object representing the property that matches the specified requirements, if found; otherwise, null. |
GetProperty(Type, String, Type)
Searches for the specified public property with the specified name and return type.
Declaration
public abstract PropertyInfo GetProperty(Type type, string name, Type returnType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the property for. |
System.String | name | The string containing the name of the property to get. |
System.Type | returnType | The return type of the property. |
Returns
Type | Description |
---|---|
System.Reflection.PropertyInfo | An object representing the property that matches the specified requirements, if found; otherwise, null. |
GetPropertyType(PropertyInfo)
Gets the type of the specified property.
Declaration
public abstract Type GetPropertyType(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the type for. |
Returns
Type | Description |
---|---|
System.Type | The property type type of the property. |
GetRaiseMethod(EventInfo, Boolean)
Returns the method that is called when the event is raised, specifying whether to return non-public methods.
Declaration
public abstract MethodInfo GetRaiseMethod(EventInfo event, bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to get the raise method for. |
System.Boolean | nonPublic | true if non-public methods can be returned; otherwise, false. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A System.Reflection.MethodInfo object that was called when the event was raised. |
GetRawConstantValue(FieldInfo)
Returns a literal value associated with the field by a compiler.
Declaration
public abstract object GetRawConstantValue(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field for which to get the literal value. |
Returns
Type | Description |
---|---|
System.Object | An object that contains the literal value associated with the field. If the literal value is a class type with an element value of zero, the return value is null. |
GetRawConstantValue(PropertyInfo)
Returns a literal value associated with the property by a compiler.
Declaration
public abstract object GetRawConstantValue(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property for which to get the literal value. |
Returns
Type | Description |
---|---|
System.Object | An object that contains the literal value associated with the property. If the literal value is a class type with an element value of zero, the return value is null. |
GetRawDefaultValue(ParameterInfo)
Gets a value indicating the default value if the parameter has a default value.
Declaration
public abstract object GetRawDefaultValue(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the default value for. |
Returns
Type | Description |
---|---|
System.Object | The default value of the parameter, or System.DBNull.Value if the parameter has no default value. |
GetReferencedAssemblies(Assembly)
Gets the System.Reflection.AssemblyName objects for all the assemblies referenced by the specified assembly
.
Declaration
public abstract IReadOnlyList<AssemblyName> GetReferencedAssemblies(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the referenced assemblies for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Reflection.AssemblyName> | An array that contains the fully parsed display names of all the assemblies referenced by the specified |
GetReflectedType(MemberInfo)
Gets the class object that was used to obtain the specified member
.
Declaration
public abstract Type GetReflectedType(MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member for which to get the reflected type. |
Returns
Type | Description |
---|---|
System.Type | The System.Type object through which the specified System.Reflection.MemberInfo object was obtained. |
GetReflectionOnly(Assembly)
Gets a System.Boolean value indicating whether specified assembly
was loaded into the reflection-only context.
Declaration
public abstract bool GetReflectionOnly(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the assembly was loaded into the reflection-only context, rather than the execution context; otherwise, false. |
GetRemoveMethod(EventInfo, Boolean)
Retrieves the System.Reflection.MethodInfo object for the System.Reflection.EventInfo.RemoveEventHandler(System.Object,System.Delegate) method of the event, specifying whether to return non-public methods.
Declaration
public abstract MethodInfo GetRemoveMethod(EventInfo event, bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to get the remove method for. |
System.Boolean | nonPublic | true if non-public methods can be returned; otherwise, false. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A System.Reflection.MethodInfo object representing the method used to remove an event handler delegate from the event source. |
GetRequiredCustomModifiers(FieldInfo)
Returns an array of types representing the required custom modifiers of the field.
Declaration
public abstract IReadOnlyList<Type> GetRequiredCustomModifiers(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to get the modifiers for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that identify the required custom modifiers of the specified |
GetRequiredCustomModifiers(ParameterInfo)
Returns an array of types representing the required custom modifiers of the parameter.
Declaration
public abstract IReadOnlyList<Type> GetRequiredCustomModifiers(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to get the modifiers for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that identify the required custom modifiers of the specified |
GetRequiredCustomModifiers(PropertyInfo)
Returns an array of types representing the required custom modifiers of the property.
Declaration
public abstract IReadOnlyList<Type> GetRequiredCustomModifiers(PropertyInfo property)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the modifiers for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of System.Type objects that identify the required custom modifiers of the |
GetReturnParameter(MethodInfo)
Gets a System.Reflection.ParameterInfo object that contains information about the return type of the method, such as whether the return type has custom modifiers.
Declaration
public abstract ParameterInfo GetReturnParameter(MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to get the return parameter for. |
Returns
Type | Description |
---|---|
System.Reflection.ParameterInfo | A System.Reflection.ParameterInfo object that contains information about the return type. |
GetReturnType(MethodInfo)
Gets the return type of the specified method
.
Declaration
public abstract Type GetReturnType(MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to get the return type for. |
Returns
Type | Description |
---|---|
System.Type | A System.Type object that contains information about the return type. |
GetReturnTypeCustomAttributes(MethodInfo)
Gets the custom attributes for the return type of the specified method
.
Declaration
public abstract ICustomAttributeProvider GetReturnTypeCustomAttributes(MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | method | The method to get the custom attributes for the return type for. |
Returns
Type | Description |
---|---|
System.Reflection.ICustomAttributeProvider | An System.Reflection.ICustomAttributeProvider object representing the custom attributes for the return type. |
GetSatelliteAssembly(Assembly, CultureInfo)
Gets the satellite assembly for the specified culture.
Declaration
public abstract Assembly GetSatelliteAssembly(Assembly assembly, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the satellite assembly from. |
System.Globalization.CultureInfo | culture | The specified culture. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The specified satellite assembly. |
GetSatelliteAssembly(Assembly, CultureInfo, Version)
Gets the specified version of the satellite assembly for the specified culture.
Declaration
public abstract Assembly GetSatelliteAssembly(Assembly assembly, CultureInfo culture, Version version)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the satellite assembly from. |
System.Globalization.CultureInfo | culture | The specified culture. |
System.Version | version | The version of the satellite assembly. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The specified satellite assembly. |
GetScopeName(Module)
Gets a string representing the name of the module.
Declaration
public abstract string GetScopeName(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to get the name for. |
Returns
Type | Description |
---|---|
System.String | The module name. |
GetSecurityRuleSet(Assembly)
Gets a value that indicates which set of security rules the common language runtime (CLR) enforces for this assembly.
Declaration
public abstract SecurityRuleSet GetSecurityRuleSet(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to get the security rules for. |
Returns
Type | Description |
---|---|
System.Security.SecurityRuleSet | The security rule set that the CLR enforces for this assembly. |
GetSetMethod(PropertyInfo, Boolean)
Returns the public or non-public set accessor for this property.
Declaration
public abstract MethodInfo GetSetMethod(PropertyInfo property, bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property to get the set accessor for. |
System.Boolean | nonPublic | true if non-public methods can be returned; otherwise, false. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A System.Reflection.MethodInfo object representing the set accessor for this property, if |
GetStructLayoutAttribute(Type)
Gets a System.Runtime.InteropServices.StructLayoutAttribute that describes the layout of the specified type
.
Declaration
public abstract StructLayoutAttribute GetStructLayoutAttribute(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the struct layout attribute for. |
Returns
Type | Description |
---|---|
System.Runtime.InteropServices.StructLayoutAttribute | A System.Runtime.InteropServices.StructLayoutAttribute that describes the gross layout features of the specified |
GetType(Assembly, String, Boolean, Boolean)
Gets the System.Type object with the specified name in the specified assembly
, with the options of ignoring the case, and of throwing an exception if the type is not found.
Declaration
public abstract Type GetType(Assembly assembly, string name, bool throwOnError, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to retrieve the type from. |
System.String | name | The full name of the type. |
System.Boolean | throwOnError | true to throw an exception if the type is not found; false to return null. |
System.Boolean | ignoreCase | true to ignore the case of the type name; otherwise, false. |
Returns
Type | Description |
---|---|
System.Type | An object that represents the specified class. |
GetType(Module, 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.
Declaration
public abstract Type GetType(Module module, string className, bool throwOnError, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to search in. |
System.String | className | The name of the type to locate. The name must be fully qualified with the namespace. |
System.Boolean | throwOnError | true to throw an exception if the type cannot be found; false to return null. |
System.Boolean | ignoreCase | true for case-insensitive search; otherwise, false. |
Returns
Type | Description |
---|---|
System.Type | A System.Type object representing the specified type, if the type is declared in this module; otherwise, null. |
GetType(String, Boolean, Boolean)
Gets the System.Type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found.
Declaration
public abstract Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | The assembly-qualified name of the type to get. See System.Type.AssemblyQualifiedName. If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace. |
System.Boolean | throwOnError | true to throw an exception if the type cannot be found; false to return null.Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. |
System.Boolean | ignoreCase | true to perform a case-insensitive search for |
Returns
Type | Description |
---|---|
System.Type | The type with the specified name. If the type is not found, the |
GetType(String, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>, Boolean, Boolean)
Gets the type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found, and optionally providing custom methods to resolve the assembly and the type.
Declaration
public abstract Type GetType(string typeName, Func<AssemblyName, Assembly> assemblyResolver, Func<Assembly, string, bool, Type> typeResolver, bool throwOnError, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | The name of the type to get. If the |
System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly> | assemblyResolver | A method that locates and returns the assembly that is specified in |
System.Func<System.Reflection.Assembly, System.String, System.Boolean, System.Type> | typeResolver | A method that locates and returns the type that is specified by |
System.Boolean | throwOnError | true to throw an exception if the type cannot be found; false to return null. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. |
System.Boolean | ignoreCase | true to perform a case-insensitive search for |
Returns
Type | Description |
---|---|
System.Type | The type with the specified name. If the type is not found, the |
GetTypeFromCLSID(Guid, String, Boolean)
Gets the type associated with the specified class identifier (CLSID) from the specified server, specifying whether to throw an exception if an error occurs while loading the type.
Declaration
public abstract Type GetTypeFromCLSID(Guid clsid, string server, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | clsid | The CLSID of the type to get. |
System.String | server | The server from which to load the type. If the server name is null, this method automatically reverts to the local machine. |
System.Boolean | throwOnError | true to throw any exception that occurs.-or- false to ignore any exception that occurs. |
Returns
Type | Description |
---|---|
System.Type | System.__ComObject regardless of whether the CLSID is valid. |
GetTypeFromHandle(RuntimeTypeHandle)
Gets the type referenced by the specified type handle.
Declaration
public abstract Type GetTypeFromHandle(RuntimeTypeHandle handle)
Parameters
Type | Name | Description |
---|---|---|
System.RuntimeTypeHandle | handle | The object that refers to the type. |
Returns
Type | Description |
---|---|
System.Type | The type referenced by the specified System.RuntimeTypeHandle, or null if the System.RuntimeTypeHandle.Value property of |
GetTypeFromProgID(String, String, Boolean)
Gets the type associated with the specified program identifier (progID) from the specified server, specifying whether to throw an exception if an error occurs while loading the type.
Declaration
public abstract Type GetTypeFromProgID(string progID, string server, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
System.String | progID | The progID of the System.Type to get. |
System.String | server | The server from which to load the type. If the server name is null, this method automatically reverts to the local machine. |
System.Boolean | throwOnError | true to throw any exception that occurs.-or- false to ignore any exception that occurs. |
Returns
Type | Description |
---|---|
System.Type | The type associated with the specified program identifier (progID), if |
GetTypeHandle(Type)
Gets the handle for the specified type
.
Declaration
public abstract RuntimeTypeHandle GetTypeHandle(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the runtime handle for. |
Returns
Type | Description |
---|---|
System.RuntimeTypeHandle | The handle for the specified |
GetTypes(Assembly)
Gets the types defined in the specified assembly
.
Declaration
public abstract IReadOnlyList<Type> GetTypes(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to retrieve the types from. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array that contains all the types that are defined in this assembly. |
GetTypes(Module)
Returns all the types defined within the specified module
.
Declaration
public abstract IReadOnlyList<Type> GetTypes(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to search in. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Type> | An array of type System.Type containing types defined within the module that is reflected by this instance. |
GetUnderlyingSystemType(Type)
Indicates the type provided by the common language runtime that represents the specified type
.
Declaration
public abstract Type GetUnderlyingSystemType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to get the underlying type for. |
Returns
Type | Description |
---|---|
System.Type | The underlying system type for the specified |
GetValue(FieldInfo, Object)
Gets the value of a field.
Declaration
public abstract object GetValue(FieldInfo field, object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to get the value from. |
System.Object | obj | The object whose field value will be retrieved, or null for a static field. |
Returns
Type | Description |
---|---|
System.Object | The value of the field. |
GetValue(PropertyInfo, Object, BindingFlags, Binder, Object[], CultureInfo)
Returns the property value of a specified object that has the specified binding, index, and culture-specific information.
Declaration
public abstract object GetValue(PropertyInfo property, object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property for which to get the value. |
System.Object | obj | The object whose property value will be returned. |
System.Reflection.BindingFlags | invokeAttr | A bitwise combination of the following enumeration members that specify the invocation attribute: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, and SetProperty. You must specify a suitable invocation attribute. For example, to invoke a static member, set the Static flag. |
System.Reflection.Binder | binder | A System.Reflection.Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If binder is null, then System.Type.DefaultBinder is used. |
System.Object[] | index | Optional index values for indexed properties. This value should be null for non-indexed properties. |
System.Globalization.CultureInfo | culture | A System.Globalization.CultureInfo used to govern the coercion of types. If this is null, the System.Globalization.CultureInfo for the current thread is used. |
Returns
Type | Description |
---|---|
System.Object | The property value of the specified object. |
HasDefaultValue(ParameterInfo)
Gets a value indicating whether the specified parameter has a default value.
Declaration
public abstract bool HasDefaultValue(ParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to check for a default value. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified parameter has a default value; otherwise, false. |
HasElementType(Type)
Gets a value indicating whether the specified type
encompasses or refers to another type; that is, whether the specified type
is an array, a pointer, or is passed by reference.
Declaration
public abstract bool HasElementType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
Invoke(ConstructorInfo, BindingFlags, Binder, Object[], CultureInfo)
Invokes the constructor with the specified arguments, under the constraints of the specified System.Reflection.Binder.
Declaration
public abstract object Invoke(ConstructorInfo constructor, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ConstructorInfo | constructor | The constructor to invoke. |
System.Reflection.BindingFlags | invokeAttr | One of the System.Reflection.BindingFlags values that specifies the type of binding. |
System.Reflection.Binder | binder | A System.Reflection.Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If binder is null, then System.Type.DefaultBinder is used. |
System.Object[] | parameters | An array of type Object used to match the number, order and type of the parameters for this constructor, under the constraints of binder. If this constructor does not require parameters, pass an array with zero elements. |
System.Globalization.CultureInfo | culture | A System.Globalization.CultureInfo used to govern the coercion of types. If this is null, the System.Globalization.CultureInfo for the current thread is used. |
Returns
Type | Description |
---|---|
System.Object | An instance of the class associated with the constructor. |
Invoke(MethodBase, Object, BindingFlags, Binder, Object[], CultureInfo)
Invokes the reflected method or constructor with the given parameters.
Declaration
public abstract object Invoke(MethodBase method, object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method or constructor to invoke. |
System.Object | obj | The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor. |
System.Reflection.BindingFlags | invokeAttr | One of the System.Reflection.BindingFlags values that specifies the type of binding. |
System.Reflection.Binder | binder | A System.Reflection.Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If binder is null, then System.Type.DefaultBinder is used. |
System.Object[] | parameters | An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null. |
System.Globalization.CultureInfo | culture | A System.Globalization.CultureInfo used to govern the coercion of types. If this is null, the System.Globalization.CultureInfo for the current thread is used. |
Returns
Type | Description |
---|---|
System.Object | An object containing the return value of the invoked method, or null in the case of a constructor, or null if the method's return type is void. |
InvokeMember(Type, String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])
Invokes the specified member, using the specified binding constraints and matching the specified argument list, modifiers and culture.
Declaration
public abstract object InvokeMember(Type type, string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to invoke a member on. |
System.String | name | The string containing the name of the constructor, method, property, or field member to invoke. |
System.Reflection.BindingFlags | invokeAttr | A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted. The access can be one of the BindingFlags such as Public, NonPublic, Private, InvokeMethod, GetField, and so on. The type of lookup need not be specified. If the type of lookup is omitted, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static are used. |
System.Reflection.Binder | binder | An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. If binder is null, then System.Type.DefaultBinder is used. |
System.Object | target | The object on which to invoke the specified member. |
System.Object[] | args | An array containing the arguments to pass to the member to invoke. |
System.Reflection.ParameterModifier[] | modifiers | An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the args array. A parameter's associated attributes are stored in the member's signature. The default binder processes this parameter only when calling a COM component. |
System.Globalization.CultureInfo | culture | The System.Globalization.CultureInfo object representing the globalization locale to use, which may be necessary for locale-specific conversions, such as converting a numeric String to a Double. If this is null, the System.Globalization.CultureInfo for the current thread is used. |
System.String[] | namedParameters | An array containing the names of the parameters to which the values in the args array are passed. |
Returns
Type | Description |
---|---|
System.Object | An object representing the return value of the invoked member. |
IsArray(Type)
Gets a value indicating whether the specified type
is an array.
Declaration
public abstract bool IsArray(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsAssignableFrom(Type, Type)
Determines whether an instance of the specified type
can be assigned from an instance of the specified type c
.
Declaration
public abstract bool IsAssignableFrom(Type type, Type c)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check for assignment compatibility. |
System.Type | c | The type to compare with the specified |
Returns
Type | Description |
---|---|
System.Boolean | true if |
IsByRef(Type)
Gets a value indicating whether the specified type
is passed by reference.
Declaration
public abstract bool IsByRef(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsCOMObject(Type)
Gets a value indicating whether the specified type
is a COM object.
Declaration
public abstract bool IsCOMObject(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsConstructedGenericType(Type)
Gets a value indicating whether the specified type
is a constructed generic type.
Declaration
public abstract bool IsConstructedGenericType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsContextful(Type)
Gets a value indicating whether the specified type
can be hosted in a context.
Declaration
public abstract bool IsContextful(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsDefined(Assembly, Type, Boolean)
Determines whether the custom attribute of the specified attributeType
type or its derived types is applied to the specified assembly
.
Declaration
public abstract bool IsDefined(Assembly assembly, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to check the custom attribute on. |
System.Type | attributeType | The type of attribute to search for. |
System.Boolean | inherit | This argument is ignored for objects of this type. |
Returns
Type | Description |
---|---|
System.Boolean | true if one or more instances of |
IsDefined(MemberInfo, Type, Boolean)
Determines whether the custom attribute of the specified attributeType
type or its derived types is applied to the specified member
.
Declaration
public abstract bool IsDefined(MemberInfo member, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to check the custom attribute on. |
System.Type | attributeType | The type of attribute to search for. |
System.Boolean | inherit | This argument is ignored for objects of this type. |
Returns
Type | Description |
---|---|
System.Boolean | true if one or more instances of |
IsDefined(Module, Type, Boolean)
Determines whether the custom attribute of the specified attributeType
type or its derived types is applied to the specified module
.
Declaration
public abstract bool IsDefined(Module module, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to check the custom attribute on. |
System.Type | attributeType | The type of attribute to search for. |
System.Boolean | inherit | This argument is ignored for objects of this type. |
Returns
Type | Description |
---|---|
System.Boolean | true if one or more instances of |
IsDefined(ParameterInfo, Type, Boolean)
Determines whether the custom attribute of the specified attributeType
type or its derived types is applied to the specified parameter
.
Declaration
public abstract bool IsDefined(ParameterInfo parameter, Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameter | The parameter to check the custom attribute on. |
System.Type | attributeType | The type of attribute to search for. |
System.Boolean | inherit | This argument is ignored for objects of this type. |
Returns
Type | Description |
---|---|
System.Boolean | true if one or more instances of |
IsDynamic(Assembly)
Gets a value that indicates whether the current assembly was generated dynamically in the current process by using reflection emit.
Declaration
public abstract bool IsDynamic(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current assembly was generated dynamically in the current process; otherwise, false. |
IsEquivalentTo(Type, Type)
Determines whether two COM types have the same identity and are eligible for type equivalence.
Declaration
public abstract bool IsEquivalentTo(Type type, Type other)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The COM type that is tested for equivalence with the other type. |
System.Type | other | The COM type that is tested for equivalence with the specified type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the COM types are equivalent; otherwise, false. This method also returns false if one type is in an assembly that is loaded for execution, and the other is in an assembly that is loaded into the reflection-only context. |
IsFullyTrusted(Assembly)
Gets a value that indicates whether the current assembly is loaded with full trust.
Declaration
public abstract bool IsFullyTrusted(Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current assembly is loaded with full trust; otherwise, false. |
IsGenericMethod(MethodBase)
Gets a value indicating whether the specified method is generic.
Declaration
public abstract bool IsGenericMethod(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsGenericMethodDefinition(MethodBase)
Gets a value indicating whether the specified method is a generic method definition.
Declaration
public abstract bool IsGenericMethodDefinition(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsGenericParameter(Type)
Gets a value indicating whether the specified type
represents a type parameter in the definition of a generic type or method.
Declaration
public abstract bool IsGenericParameter(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsGenericType(Type)
Gets a value indicating whether the specified type
is a generic type.
Declaration
public abstract bool IsGenericType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsGenericTypeDefinition(Type)
Gets a value indicating whether the specified type
represents a generic type definition, from which other generic types can be constructed.
Declaration
public abstract bool IsGenericTypeDefinition(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsInstanceOfType(Type, Object)
Determines whether the specified object is an instance of the specified type
.
Declaration
public abstract bool IsInstanceOfType(Type type, object o)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to compare the object against. |
System.Object | o | The object to compare with the specified type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsInterface(Type)
Gets a value indicating whether the specified type
is an interface type.
Declaration
public abstract bool IsInterface(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsMarshalByRef(Type)
Gets a value indicating whether the specified type
is marshaled by reference.
Declaration
public abstract bool IsMarshalByRef(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsMulticast(EventInfo)
Gets a value indicating whether the event is multicast.
Declaration
public abstract bool IsMulticast(EventInfo event)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to check for multicast. |
Returns
Type | Description |
---|---|
System.Boolean | true if the delegate is an instance of a multicast delegate; otherwise, false. |
IsPointer(Type)
Gets a value indicating whether the specified type
is a pointer.
Declaration
public abstract bool IsPointer(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsPrimitive(Type)
Gets a value indicating whether the specified type
is one of the primitive types.
Declaration
public abstract bool IsPrimitive(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsResource(Module)
Gets a value indicating whether the object is a resource.
Declaration
public abstract bool IsResource(Module module)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the object is a resource; otherwise, false. |
IsSecurityCritical(FieldInfo)
Gets a value that indicates whether the specified field
is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations.
Declaration
public abstract bool IsSecurityCritical(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsSecurityCritical(MethodBase)
Gets a value that indicates whether the specified method or constructor is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations.
Declaration
public abstract bool IsSecurityCritical(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current method or constructor is security-critical or security-safe-critical at the current trust level; false if it is transparent. |
IsSecurityCritical(Type)
Gets a value that indicates whether the specified type
is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations.
Declaration
public abstract bool IsSecurityCritical(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsSecuritySafeCritical(FieldInfo)
Gets a value that indicates whether the specified field
is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code.
Declaration
public abstract bool IsSecuritySafeCritical(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsSecuritySafeCritical(MethodBase)
Gets a value that indicates whether the specified method or constructor is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code.
Declaration
public abstract bool IsSecuritySafeCritical(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the method or constructor is security-safe-critical at the current trust level; false if it is security-critical or transparent. |
IsSecuritySafeCritical(Type)
Gets a value that indicates whether the specified type
is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code.
Declaration
public abstract bool IsSecuritySafeCritical(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsSecurityTransparent(FieldInfo)
Gets a value that indicates whether the specified field
is transparent at the current trust level, and therefore cannot perform critical operations.
Declaration
public abstract bool IsSecurityTransparent(FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsSecurityTransparent(MethodBase)
Gets a value that indicates whether the specified method or constructor is transparent at the current trust level, and therefore cannot perform critical operations.
Declaration
public abstract bool IsSecurityTransparent(MethodBase method)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase | method | The method to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the method or constructor is security-transparent at the current trust level; otherwise, false. |
IsSecurityTransparent(Type)
Gets a value that indicates whether the specified type
is transparent at the current trust level, and therefore cannot perform critical operations.
Declaration
public abstract bool IsSecurityTransparent(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsSerializable(Type)
Gets a value indicating whether the System.Type is serializable.
Declaration
public abstract bool IsSerializable(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsSubclassOf(Type, Type)
Determines whether the class represented by the specified type
derives from the class represented by the specified type c
.
Declaration
public abstract bool IsSubclassOf(Type type, Type c)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check for being a subclass. |
System.Type | c | The type to compare with the specified type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the type represented by the |
IsValueType(Type)
Gets a value indicating whether the specified type
is a value type.
Declaration
public abstract bool IsValueType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
IsVisible(Type)
Gets a value indicating whether the specified type
can be accessed by code outside the assembly.
Declaration
public abstract bool IsVisible(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified |
Load(AssemblyName)
Loads an assembly given its System.Reflection.AssemblyName.
Declaration
public abstract Assembly Load(AssemblyName assemblyRef)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.AssemblyName | assemblyRef | The object that describes the assembly to be loaded. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |
Load(String)
Loads an assembly given the long form of its name.
Declaration
public abstract Assembly Load(string assemblyString)
Parameters
Type | Name | Description |
---|---|---|
System.String | assemblyString | The long form of the assembly name. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |
LoadFile(String)
Loads the contents of an assembly file on the specified path.
Declaration
public abstract Assembly LoadFile(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path of the file to load. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |
LoadFrom(String, Byte[], AssemblyHashAlgorithm)
Loads an assembly given its file name or path, hash value, and hash algorithm.
Declaration
public abstract Assembly LoadFrom(string assemblyFile, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
Parameters
Type | Name | Description |
---|---|---|
System.String | assemblyFile | The name or path of the file that contains the manifest of the assembly. |
System.Byte[] | hashValue | The value of the computed hash code. |
System.Configuration.Assemblies.AssemblyHashAlgorithm | hashAlgorithm | The hash algorithm used for hashing files and for generating the strong name. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |
LoadModule(Assembly, String, Byte[], Byte[])
Loads the module, internal to the specified assembly
, with a common object file format (COFF)-based image containing an emitted module, or a resource file. The raw bytes representing the symbols for the module are also loaded.
Declaration
public abstract Module LoadModule(Assembly assembly, string moduleName, byte[] rawModule, byte[] rawSymbolStore)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to load the module into. |
System.String | moduleName | The name of the module. This string must correspond to a file name in this assembly's manifest. |
System.Byte[] | rawModule | A byte array that is a COFF-based image containing an emitted module, or a resource. |
System.Byte[] | rawSymbolStore | A byte array containing the raw bytes representing the symbols for the module. Must be null if this is a resource file. |
Returns
Type | Description |
---|---|
System.Reflection.Module | The loaded module. |
MakeArrayType(Type)
Makes a single-dimensional (vector) array type with the specified element type.
Declaration
public abstract Type MakeArrayType(Type elementType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | elementType | The element type of the array. |
Returns
Type | Description |
---|---|
System.Type | A single-dimensional (vector) array type with the specified element type. |
MakeArrayType(Type, Int32)
Makes a multi-dimensional array type with the specified element type and rank.
Declaration
public abstract Type MakeArrayType(Type elementType, int rank)
Parameters
Type | Name | Description |
---|---|---|
System.Type | elementType | The element type of the array. |
System.Int32 | rank | The rank of the multi-dimensional array. |
Returns
Type | Description |
---|---|
System.Type | A multi-dimensional array type with the specified element type and rank. |
MakeByRefType(Type)
Makes a by-ref type with the specified underlying element type.
Declaration
public abstract Type MakeByRefType(Type elementType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | elementType | The underlying element type. |
Returns
Type | Description |
---|---|
System.Type | A by-ref type with the specified underlying element type. |
MakeGenericMethod(MethodInfo, Type[])
Makes a generic method with the specified generic method definition and type arguments.
Declaration
public abstract MethodInfo MakeGenericMethod(MethodInfo genericMethodDefinition, params Type[] typeArguments)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | genericMethodDefinition | The generic method definition. |
System.Type[] | typeArguments | The type arguments. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | A generic method with the specified generic method definition and type arguments. |
MakeGenericType(Type, Type[])
Makes a generic type with the specified generic type definition and type arguments.
Declaration
public abstract Type MakeGenericType(Type genericTypeDefinition, params Type[] typeArguments)
Parameters
Type | Name | Description |
---|---|---|
System.Type | genericTypeDefinition | The generic type definition. |
System.Type[] | typeArguments | The type arguments. |
Returns
Type | Description |
---|---|
System.Type | A generic type with the specified generic type definition and type arguments. |
MakePointerType(Type)
Makes a pointer type with the specified underlying element type.
Declaration
public abstract Type MakePointerType(Type elementType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | elementType | The underlying element type. |
Returns
Type | Description |
---|---|
System.Type | A pointer type with the specified underlying element type. |
ReflectionOnlyGetType(String, Boolean, Boolean)
Gets the System.Type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found. The type is loaded for reflection only, not for execution.
Declaration
public abstract Type ReflectionOnlyGetType(string typeName, bool throwIfNotFound, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | The assembly-qualified name of the System.Type to get. |
System.Boolean | throwIfNotFound | true to throw a System.TypeLoadException if the type cannot be found; false to return null if the type cannot be found. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. |
System.Boolean | ignoreCase | true to perform a case-insensitive search for |
Returns
Type | Description |
---|---|
System.Type | The type with the specified name, if found; otherwise, null. If the type is not found, the |
ReflectionOnlyLoad(Byte[])
Loads the assembly from a common object file format (COFF)-based image containing an emitted assembly. The assembly is loaded into the reflection-only context of the caller's application domain.
Declaration
public abstract Assembly ReflectionOnlyLoad(byte[] rawAssembly)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | rawAssembly | A byte array that is a COFF-based image containing an emitted assembly. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |
ReflectionOnlyLoad(String)
Loads an assembly into the reflection-only context, given its display name.
Declaration
public abstract Assembly ReflectionOnlyLoad(string assemblyString)
Parameters
Type | Name | Description |
---|---|---|
System.String | assemblyString | The display name of the assembly, as returned by the System.Reflection.AssemblyName.FullName property. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |
ReflectionOnlyLoadFrom(String)
Loads an assembly into the reflection-only context, given its path.
Declaration
public abstract Assembly ReflectionOnlyLoadFrom(string assemblyFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | assemblyFile | The path of the file that contains the manifest of the assembly. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |
RemoveEventHandler(EventInfo, Object, Delegate)
Removes an event handler from an event source.
Declaration
public abstract void RemoveEventHandler(EventInfo event, object target, Delegate handler)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | event | The event to remove a handler from. |
System.Object | target | The event source. |
System.Delegate | handler | The delegate to be disassociated from the events raised by target. |
RemoveModuleResolve(Assembly, ModuleResolveEventHandler)
Removes a module resolve handler.
Declaration
public abstract void RemoveModuleResolve(Assembly assembly, ModuleResolveEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly to remove a module resolve handler for. |
System.Reflection.ModuleResolveEventHandler | handler | The module resolve handler to remove. |
Remarks
Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.
ResolveField(Module, Int32, Type[], Type[])
Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters.
Declaration
public abstract FieldInfo ResolveField(Module module, int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to resolve the metadata token in. |
System.Int32 | metadataToken | A metadata token that identifies a field in the module. |
System.Type[] | genericTypeArguments | An array of 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. |
System.Type[] | genericMethodArguments | An array of 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
Type | Description |
---|---|
System.Reflection.FieldInfo | A System.Reflection.FieldInfo object representing the field that is identified by the specified metadata token. |
ResolveMember(Module, Int32, Type[], Type[])
Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters.
Declaration
public abstract MemberInfo ResolveMember(Module module, int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to resolve the metadata token in. |
System.Int32 | metadataToken | A metadata token that identifies a type or member in the module. |
System.Type[] | genericTypeArguments | An array of 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. |
System.Type[] | genericMethodArguments | An array of 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
Type | Description |
---|---|
System.Reflection.MemberInfo | A System.Reflection.MemberInfo object representing the type or member that is identified by the specified metadata token. |
ResolveMethod(Module, Int32, Type[], Type[])
Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters.
Declaration
public abstract MethodBase ResolveMethod(Module module, int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to resolve the metadata token in. |
System.Int32 | metadataToken | A metadata token that identifies a method or constructor in the module. |
System.Type[] | genericTypeArguments | An array of 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. |
System.Type[] | genericMethodArguments | An array of 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
Type | Description |
---|---|
System.Reflection.MethodBase | A System.Reflection.MethodBase object representing the method that is identified by the specified metadata token. |
ResolveSignature(Module, Int32)
Returns the signature blob identified by a metadata token.
Declaration
public abstract byte[] ResolveSignature(Module module, int metadataToken)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to resolve the metadata token in. |
System.Int32 | metadataToken | A metadata token that identifies a signature in the module. |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes representing the signature blob. |
ResolveString(Module, Int32)
Returns the string identified by the specified metadata token.
Declaration
public abstract string ResolveString(Module module, int metadataToken)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to resolve the metadata token in. |
System.Int32 | metadataToken | A metadata token that identifies a string in the string heap of the module. |
Returns
Type | Description |
---|---|
System.String | A System.String containing a string value from the metadata string heap. |
ResolveType(Module, Int32, Type[], Type[])
Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters.
Declaration
public abstract Type ResolveType(Module module, int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Module | module | The module to resolve the metadata token in. |
System.Int32 | metadataToken | A metadata token that identifies a type in the module. |
System.Type[] | genericTypeArguments | An array of 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. |
System.Type[] | genericMethodArguments | An array of 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
Type | Description |
---|---|
System.Type | A System.Type object representing the type that is identified by the specified metadata token. |
SetValue(FieldInfo, Object, Object, BindingFlags, Binder, CultureInfo)
Sets the value of a field.
Declaration
public abstract void SetValue(FieldInfo field, object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | field | The field to set the value on. |
System.Object | obj | The object whose field value will be set, or null for a static field. |
System.Object | value | The value to assign to the field. |
System.Reflection.BindingFlags | invokeAttr | One of the System.Reflection.BindingFlags values that specifies the type of binding. |
System.Reflection.Binder | binder | A System.Reflection.Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If binder is null, then System.Type.DefaultBinder is used. |
System.Globalization.CultureInfo | culture | A System.Globalization.CultureInfo used to govern the coercion of types. If this is null, the System.Globalization.CultureInfo for the current thread is used. |
SetValue(PropertyInfo, Object, Object, BindingFlags, Binder, Object[], CultureInfo)
Sets the property value for a specified object that has the specified binding, index, and culture-specific information.
Declaration
public abstract void SetValue(PropertyInfo property, object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | property | The property for which to set the value. |
System.Object | obj | The object whose property value will be set. |
System.Object | value | The new property value. |
System.Reflection.BindingFlags | invokeAttr | A bitwise combination of the following enumeration members that specify the invocation attribute: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. You must specify a suitable invocation attribute. For example, to invoke a static member, set the Static flag. |
System.Reflection.Binder | binder | A System.Reflection.Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If binder is null, then System.Type.DefaultBinder is used. |
System.Object[] | index | Optional index values for indexed properties. This value should be null for non-indexed properties. |
System.Globalization.CultureInfo | culture | A System.Globalization.CultureInfo used to govern the coercion of types. If this is null, the System.Globalization.CultureInfo for the current thread is used. |
UnsafeLoadFrom(String)
Loads an assembly into the load-from context, bypassing some security checks.
Declaration
public abstract Assembly UnsafeLoadFrom(string assemblyFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | assemblyFile | The name or path of the file that contains the manifest of the assembly. |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | The loaded assembly. |