mscorlib(4.0.0.0) API with additions
|
Discovers the attributes of a method and provides access to method metadata. More...
Public Member Functions | |
override bool | Equals (object obj) |
Returns a value that indicates whether this instance is equal to a specified object. More... | |
override int | GetHashCode () |
Returns the hash code for this instance. More... | |
abstract MethodInfo | GetBaseDefinition () |
When overridden in a derived class, returns the T: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. More... | |
override Type [] | GetGenericArguments () |
Returns an array of T:System.Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition. More... | |
virtual MethodInfo | GetGenericMethodDefinition () |
Returns a T:System.Reflection.MethodInfo object that represents a generic method definition from which the current method can be constructed. More... | |
virtual MethodInfo | MakeGenericMethod (params Type[] typeArguments) |
Substitutes the elements of an array of types for the type parameters of the current generic method definition, and returns a T:System.Reflection.MethodInfo object representing the resulting constructed method. More... | |
virtual Delegate | CreateDelegate (Type delegateType) |
Creates a delegate of the specified type from this method. More... | |
virtual Delegate | CreateDelegate (Type delegateType, object target) |
Creates a delegate of the specified type with the specified target from this method. More... | |
![]() | |
override bool | Equals (object obj) |
Returns a value that indicates whether this instance is equal to a specified object. More... | |
override int | GetHashCode () |
Returns the hash code for this instance. More... | |
abstract ParameterInfo [] | GetParameters () |
When overridden in a derived class, gets the parameters of the specified method or constructor. More... | |
abstract MethodImplAttributes | GetMethodImplementationFlags () |
When overridden in a derived class, returns the T:System.Reflection.MethodImplAttributes flags. More... | |
abstract object | Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) |
When overridden in a derived class, invokes the reflected method or constructor with the given parameters. More... | |
object | Invoke (object obj, object[] parameters) |
Invokes the method or constructor represented by the current instance, using the specified parameters. More... | |
virtual MethodBody | GetMethodBody () |
When overridden in a derived class, gets a T:System.Reflection.MethodBody object that provides access to the MSIL stream, local variables, and exceptions for the current method. More... | |
![]() | |
abstract object [] | GetCustomAttributes (bool inherit) |
When overridden in a derived class, returns an array of all custom attributes applied to this member. More... | |
abstract object [] | GetCustomAttributes (Type attributeType, bool inherit) |
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by T:System.Type. More... | |
abstract bool | IsDefined (Type attributeType, bool inherit) |
When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. More... | |
virtual IList< CustomAttributeData > | GetCustomAttributesData () |
Returns a list of T:System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the target member. More... | |
override bool | Equals (object obj) |
Returns a value that indicates whether this instance is equal to a specified object. More... | |
override int | GetHashCode () |
Returns the hash code for this instance. More... | |
![]() | |
new string | ToString () |
Provides COM objects with version-independent access to the M:System.Object.ToString method. More... | |
![]() | |
new string | ToString () |
Provides COM objects with version-independent access to the M:System.Object.ToString method. More... | |
object [] | GetCustomAttributes (Type attributeType, bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Type,System.Boolean) method. More... | |
object [] | GetCustomAttributes (bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean) method. More... | |
bool | IsDefined (Type attributeType, bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean) method. More... | |
![]() | |
new string | ToString () |
Provides COM objects with version-independent access to the M:System.Object.ToString method. More... | |
object [] | GetCustomAttributes (Type attributeType, bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Type,System.Boolean) method. More... | |
object [] | GetCustomAttributes (bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean) method. More... | |
bool | IsDefined (Type attributeType, bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean) method. More... | |
ParameterInfo [] | GetParameters () |
Provides COM objects with version-independent access to the M:System.Reflection.MethodBase.GetParameters method. More... | |
MethodImplAttributes | GetMethodImplementationFlags () |
Provides COM objects with version-independent access to the M:System.Reflection.MethodBase.GetMethodImplementationFlags method. More... | |
object | Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) |
Provides COM objects with version-independent access to the M:System.Reflection.MethodBase.Invoke(System.Object,System.Reflection.BindingFlags,System.Reflection.Binder,System.Object[],System.Globalization.CultureInfo) method. More... | |
object | Invoke (object obj, object[] parameters) |
Provides COM objects with version-independent access to the M:System.Reflection.MethodBase.Invoke(System.Object,System.Object[]) method. More... | |
Static Public Member Functions | |
static bool | operator== (MethodInfo left, MethodInfo right) |
Indicates whether two T:System.Reflection.MethodInfo objects are equal. More... | |
static bool | operator != (MethodInfo left, MethodInfo right) |
Indicates whether two T:System.Reflection.MethodInfo objects are not equal. More... | |
![]() | |
static MethodBase | GetMethodFromHandle (RuntimeMethodHandle handle) |
Gets method information by using the method's internal metadata representation (handle). More... | |
static MethodBase | GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType) |
Gets a T:System.Reflection.MethodBase object for the constructor or method represented by the specified handle, for the specified generic type. More... | |
static MethodBase | GetCurrentMethod () |
Returns a MethodBase object representing the currently executing method. More... | |
static bool | operator== (MethodBase left, MethodBase right) |
Indicates whether two T:System.Reflection.MethodBase objects are equal. More... | |
static bool | operator != (MethodBase left, MethodBase right) |
Indicates whether two T:System.Reflection.MethodBase objects are not equal. More... | |
![]() | |
static bool | operator== (MemberInfo left, MemberInfo right) |
Indicates whether two T:System.Reflection.MemberInfo objects are equal. More... | |
static bool | operator != (MemberInfo left, MemberInfo right) |
Indicates whether two T:System.Reflection.MemberInfo objects are not equal. More... | |
Public Attributes | |
override MemberTypes | MemberType => MemberTypes.Method |
Gets a T:System.Reflection.MemberTypes value indicating that this member is a method. More... | |
Properties | |
virtual Type | ReturnType [get] |
Gets the return type of this method. More... | |
virtual ParameterInfo | ReturnParameter [get] |
Gets a T:System.Reflection.ParameterInfo object that contains information about the return type of the method, such as whether the return type has custom modifiers. More... | |
abstract ICustomAttributeProvider | ReturnTypeCustomAttributes [get] |
Gets the custom attributes for the return type. More... | |
![]() | |
virtual MethodImplAttributes | MethodImplementationFlags [get] |
Gets the T:System.Reflection.MethodImplAttributes flags that specify the attributes of a method implementation. More... | |
abstract RuntimeMethodHandle | MethodHandle [get] |
Gets a handle to the internal metadata representation of a method. More... | |
abstract MethodAttributes | Attributes [get] |
Gets the attributes associated with this method. More... | |
virtual CallingConventions | CallingConvention [get] |
Gets a value indicating the calling conventions for this method. More... | |
virtual bool | IsGenericMethodDefinition [get] |
Gets a value indicating whether the method is a generic method definition. More... | |
virtual bool | ContainsGenericParameters [get] |
Gets a value indicating whether the generic method contains unassigned generic type parameters. More... | |
virtual bool | IsGenericMethod [get] |
Gets a value indicating whether the method is generic. More... | |
virtual bool | IsSecurityCritical [get] |
Gets a value that indicates whether the current method or constructor is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations. More... | |
virtual bool | IsSecuritySafeCritical [get] |
Gets a value that indicates whether the current 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. More... | |
virtual bool | IsSecurityTransparent [get] |
Gets a value that indicates whether the current method or constructor is transparent at the current trust level, and therefore cannot perform critical operations. More... | |
bool | IsPublic [get] |
Gets a value indicating whether this is a public method. More... | |
bool | IsPrivate [get] |
Gets a value indicating whether this member is private. More... | |
bool | IsFamily [get] |
Gets a value indicating whether the visibility of this method or constructor is described by F:System.Reflection.MethodAttributes.Family; that is, the method or constructor is visible only within its class and derived classes. More... | |
bool | IsAssembly [get] |
Gets a value indicating whether the potential visibility of this method or constructor is described by F:System.Reflection.MethodAttributes.Assembly; that is, the method or constructor is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly. More... | |
bool | IsFamilyAndAssembly [get] |
Gets a value indicating whether the visibility of this method or constructor is described by F:System.Reflection.MethodAttributes.FamANDAssem; that is, the method or constructor can be called by derived classes, but only if they are in the same assembly. More... | |
bool | IsFamilyOrAssembly [get] |
Gets a value indicating whether the potential visibility of this method or constructor is described by F:System.Reflection.MethodAttributes.FamORAssem; that is, the method or constructor can be called by derived classes wherever they are, and by classes in the same assembly. More... | |
bool | IsStatic [get] |
Gets a value indicating whether the method is static . More... | |
bool | IsFinal [get] |
Gets a value indicating whether this method is final . More... | |
bool | IsVirtual [get] |
Gets a value indicating whether the method is virtual . More... | |
bool | IsHideBySig [get] |
Gets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class. More... | |
bool | IsAbstract [get] |
Gets a value indicating whether the method is abstract. More... | |
bool | IsSpecialName [get] |
Gets a value indicating whether this method has a special name. More... | |
bool | IsConstructor [get] |
Gets a value indicating whether the method is a constructor. More... | |
![]() | |
abstract MemberTypes | MemberType [get] |
When overridden in a derived class, gets a T:System.Reflection.MemberTypes value indicating the type of the member — method, constructor, event, and so on. More... | |
abstract string | Name [get] |
Gets the name of the current member. More... | |
abstract Type | DeclaringType [get] |
Gets the class that declares this member. More... | |
abstract Type | ReflectedType [get] |
Gets the class object that was used to obtain this instance of MemberInfo . More... | |
virtual IEnumerable< CustomAttributeData > | CustomAttributes [get] |
Gets a collection that contains this member's custom attributes. More... | |
virtual int | MetadataToken [get] |
Gets a value that identifies a metadata element. More... | |
virtual Module | Module [get] |
Gets the module in which the type that declares the member represented by the current T:System.Reflection.MemberInfo is defined. More... | |
![]() | |
MemberTypes | MemberType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.MemberType property. More... | |
string | Name [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More... | |
Type | DeclaringType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More... | |
Type | ReflectedType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More... | |
![]() | |
MemberTypes | MemberType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.MemberType property. More... | |
string | Name [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More... | |
Type | DeclaringType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More... | |
Type | ReflectedType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More... | |
RuntimeMethodHandle | MethodHandle [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.MethodHandle property. More... | |
MethodAttributes | Attributes [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.Attributes property. More... | |
CallingConventions | CallingConvention [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.CallingConvention property. More... | |
bool | IsPublic [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsPublic property. More... | |
bool | IsPrivate [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsPrivate property. More... | |
bool | IsFamily [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFamily property. More... | |
bool | IsAssembly [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsAssembly property. More... | |
bool | IsFamilyAndAssembly [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFamilyAndAssembly property. More... | |
bool | IsFamilyOrAssembly [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFamilyOrAssembly property. More... | |
bool | IsStatic [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsStatic property. More... | |
bool | IsFinal [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFinal property. More... | |
bool | IsVirtual [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsVirtual property. More... | |
bool | IsHideBySig [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsHideBySig property. More... | |
bool | IsAbstract [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsAbstract property. More... | |
bool | IsSpecialName [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsSpecialName property. More... | |
bool | IsConstructor [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsConstructor property. More... | |
![]() | |
MemberTypes | MemberType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.MemberType property. More... | |
string | Name [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More... | |
Type | DeclaringType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More... | |
Type | ReflectedType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More... | |
RuntimeMethodHandle | MethodHandle [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.MethodHandle property. More... | |
MethodAttributes | Attributes [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.Attributes property. More... | |
CallingConventions | CallingConvention [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.CallingConvention property. More... | |
bool | IsPublic [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsPublic property. More... | |
bool | IsPrivate [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsPrivate property. More... | |
bool | IsFamily [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFamily property. More... | |
bool | IsAssembly [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsAssembly property. More... | |
bool | IsFamilyAndAssembly [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFamilyAndAssembly property. More... | |
bool | IsFamilyOrAssembly [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFamilyOrAssembly property. More... | |
bool | IsStatic [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsStatic property. More... | |
bool | IsFinal [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsFinal property. More... | |
bool | IsVirtual [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsVirtual property. More... | |
bool | IsHideBySig [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsHideBySig property. More... | |
bool | IsAbstract [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsAbstract property. More... | |
bool | IsSpecialName [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsSpecialName property. More... | |
bool | IsConstructor [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodBase.IsConstructor property. More... | |
Type | ReturnType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodInfo.ReturnType property. More... | |
ICustomAttributeProvider | ReturnTypeCustomAttributes [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MethodInfo.ReturnTypeCustomAttributes property. More... | |
Discovers the attributes of a method and provides access to method metadata.
Definition at line 13 of file MethodInfo.cs.
Creates a delegate of the specified type from this method.
delegateType | The type of the delegate to create. |
Reimplemented in System.Reflection.Emit.DynamicMethod.
Definition at line 143 of file MethodInfo.cs.
|
virtual |
Creates a delegate of the specified type with the specified target from this method.
delegateType | The type of the delegate to create. |
target | The object targeted by the delegate. |
Reimplemented in System.Reflection.Emit.DynamicMethod.
Definition at line 153 of file MethodInfo.cs.
override bool System.Reflection.MethodInfo.Equals | ( | object | obj | ) |
Returns a value that indicates whether this instance is equal to a specified object.
obj | An object to compare with this instance, or null . |
true
if obj equals the type and value of this instance; otherwise, false
.Implements System.Runtime.InteropServices._MethodInfo.
Definition at line 86 of file MethodInfo.cs.
|
pure virtual |
When overridden in a derived class, returns the T: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.
Implements System.Runtime.InteropServices._MethodInfo.
Implemented in System.Reflection.Emit.DynamicMethod, and System.Reflection.Emit.MethodBuilder.
|
virtual |
Returns an array of T:System.Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition.
T:System.NotSupportedException | This method is not supported. |
Reimplemented from System.Reflection.MethodBase.
Reimplemented in System.Reflection.Emit.MethodBuilder.
Definition at line 109 of file MethodInfo.cs.
|
virtual |
Returns a T:System.Reflection.MethodInfo object that represents a generic method definition from which the current method can be constructed.
T:System.InvalidOperationException | The current method is not a generic method. That is, P:System.Reflection.MethodInfo.IsGenericMethod returns false . |
T:System.NotSupportedException | This method is not supported. |
Reimplemented in System.Reflection.Emit.MethodBuilder.
Definition at line 120 of file MethodInfo.cs.
override int System.Reflection.MethodInfo.GetHashCode | ( | ) |
Returns the hash code for this instance.
Implements System.Runtime.InteropServices._MethodInfo.
Definition at line 94 of file MethodInfo.cs.
|
virtual |
Substitutes the elements of an array of types for the type parameters of the current generic method definition, and returns a T:System.Reflection.MethodInfo object representing the resulting constructed method.
typeArguments | An array of types to be substituted for the type parameters of the current generic method definition. |
T:System.InvalidOperationException | The current T:System.Reflection.MethodInfo does not represent a generic method definition. That is, P:System.Reflection.MethodInfo.IsGenericMethodDefinition returns false . |
T:System.ArgumentNullException | typeArguments is null .-or- Any element of typeArguments is null . |
T:System.ArgumentException | The number of elements in typeArguments is not the same as the number of type parameters of the current generic method definition.-or- An element of typeArguments does not satisfy the constraints specified for the corresponding type parameter of the current generic method definition. |
T:System.NotSupportedException | This method is not supported. |
Reimplemented in System.Reflection.Emit.MethodBuilder.
Definition at line 134 of file MethodInfo.cs.
|
static |
Indicates whether two T:System.Reflection.MethodInfo objects are not equal.
left | The first object to compare. |
right | The second object to compare. |
true
if left is not equal to right ; otherwise, false
.Definition at line 76 of file MethodInfo.cs.
|
static |
Indicates whether two T:System.Reflection.MethodInfo objects are equal.
left | The first object to compare. |
right | The second object to compare. |
true
if left is equal to right ; otherwise, false
.Definition at line 57 of file MethodInfo.cs.
override MemberTypes System.Reflection.MethodInfo.MemberType => MemberTypes.Method |
Gets a T:System.Reflection.MemberTypes value indicating that this member is a method.
Definition at line 17 of file MethodInfo.cs.
|
get |
Gets a T:System.Reflection.ParameterInfo object that contains information about the return type of the method, such as whether the return type has custom modifiers.
T:System.NotImplementedException | This method is not implemented. |
Definition at line 36 of file MethodInfo.cs.
|
get |
Gets the return type of this method.
Definition at line 23 of file MethodInfo.cs.
|
get |
Gets the custom attributes for the return type.
ICustomAttributeProvider
object representing the custom attributes for the return type.Definition at line 47 of file MethodInfo.cs.