Show / Hide Table of Contents

Class Method<TSignature>

Represents reflected method.

Inheritance
Object
MemberInfo
MethodBase
MethodInfo
Method<TSignature>
Implements
IMethod<TSignature>
IMethod<MethodInfo, TSignature>
IMember<MethodInfo, TSignature>
IMember<MethodInfo>
ICustomAttributeProvider
System.IConvertible<TSignature>
IEquatable<MethodInfo>
Inherited Members
MethodBase.GetCurrentMethod()
MethodBase.GetMethodFromHandle(RuntimeMethodHandle)
MethodBase.GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle)
MethodBase.Invoke(Object, Object[])
MethodBase.IsAbstract
MethodBase.IsAssembly
MethodBase.IsConstructedGenericMethod
MethodBase.IsConstructor
MethodBase.IsFamily
MethodBase.IsFamilyAndAssembly
MethodBase.IsFamilyOrAssembly
MethodBase.IsFinal
MethodBase.IsHideBySig
MethodBase.IsPrivate
MethodBase.IsPublic
MethodBase.IsSpecialName
MethodBase.IsStatic
MethodBase.IsVirtual
MemberInfo.HasSameMetadataDefinitionAs(MemberInfo)
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public sealed class Method<TSignature> : MethodInfo, IMethod<TSignature>, IMethod<MethodInfo, TSignature>, IMember<MethodInfo, TSignature>, IMember<MethodInfo>, ICustomAttributeProvider, IConvertible<TSignature>, IEquatable<MethodInfo> where TSignature : MulticastDelegate
Type Parameters
Name Description
TSignature

Type of delegate describing signature of the reflected method.

Properties

| Improve this Doc View Source

Attributes

Gets the attributes associated with this method.

Declaration
public override MethodAttributes Attributes { get; }
Property Value
Type Description
MethodAttributes
Overrides
MethodBase.Attributes
| Improve this Doc View Source

CallingConvention

Gets a value indicating the calling conventions for this constructor.

Declaration
public override CallingConventions CallingConvention { get; }
Property Value
Type Description
CallingConventions
Overrides
MethodBase.CallingConvention
| Improve this Doc View Source

ContainsGenericParameters

Gets a value indicating whether the generic method contains unassigned generic type parameters.

Declaration
public override bool ContainsGenericParameters { get; }
Property Value
Type Description
Boolean
Overrides
MethodBase.ContainsGenericParameters
| Improve this Doc View Source

CustomAttributes

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

Declaration
public override IEnumerable<CustomAttributeData> CustomAttributes { get; }
Property Value
Type Description
IEnumerable<CustomAttributeData>
Overrides
MemberInfo.CustomAttributes
| Improve this Doc View Source

DeclaringType

Gets the class that declares this method.

Declaration
public override Type DeclaringType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.DeclaringType
| Improve this Doc View Source

IsGenericMethod

Gets a value indicating whether the method is generic.

Declaration
public override bool IsGenericMethod { get; }
Property Value
Type Description
Boolean
Overrides
MethodBase.IsGenericMethod
| Improve this Doc View Source

IsGenericMethodDefinition

Gets a value indicating whether the method is a generic method definition.

Declaration
public override bool IsGenericMethodDefinition { get; }
Property Value
Type Description
Boolean
Overrides
MethodBase.IsGenericMethodDefinition
| Improve this Doc View Source

IsSecurityCritical

Gets a value that indicates whether the method is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations.

Declaration
public override bool IsSecurityCritical { get; }
Property Value
Type Description
Boolean
Overrides
MethodBase.IsSecurityCritical
| Improve this Doc View Source

IsSecuritySafeCritical

Gets a value that indicates whether the method 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 override bool IsSecuritySafeCritical { get; }
Property Value
Type Description
Boolean
Overrides
MethodBase.IsSecuritySafeCritical
| Improve this Doc View Source

IsSecurityTransparent

Gets a value that indicates whether the current method is transparent at the current trust level, and therefore cannot perform critical operations.

Declaration
public override bool IsSecurityTransparent { get; }
Property Value
Type Description
Boolean
Overrides
MethodBase.IsSecurityTransparent
| Improve this Doc View Source

MemberType

Always returns Method.

Declaration
public override MemberTypes MemberType { get; }
Property Value
Type Description
MemberTypes
Overrides
MethodInfo.MemberType
| Improve this Doc View Source

MetadataToken

Gets a value that identifies a metadata element.

Declaration
public override int MetadataToken { get; }
Property Value
Type Description
Int32
Overrides
MemberInfo.MetadataToken
| Improve this Doc View Source

MethodHandle

Gets a handle to the internal metadata representation of a method.

Declaration
public override RuntimeMethodHandle MethodHandle { get; }
Property Value
Type Description
RuntimeMethodHandle
Overrides
MethodBase.MethodHandle
| Improve this Doc View Source

MethodImplementationFlags

Gets method implementation attributes.

Declaration
public override MethodImplAttributes MethodImplementationFlags { get; }
Property Value
Type Description
MethodImplAttributes
Overrides
MethodBase.MethodImplementationFlags
| Improve this Doc View Source

Module

Gets the module in which the type that declares the method represented by the current instance is defined.

Declaration
public override Module Module { get; }
Property Value
Type Description
Module
Overrides
MemberInfo.Module
| Improve this Doc View Source

Name

Gets name of this method.

Declaration
public override string Name { get; }
Property Value
Type Description
String
Overrides
MemberInfo.Name
| Improve this Doc View Source

ReflectedType

Gets the class object that was used to obtain this instance.

Declaration
public override Type ReflectedType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.ReflectedType
| Improve this Doc View Source

ReturnParameter

Gets information about the return type of the method, such as whether the return type has custom modifiers.

Declaration
public override ParameterInfo ReturnParameter { get; }
Property Value
Type Description
ParameterInfo
Overrides
MethodInfo.ReturnParameter
| Improve this Doc View Source

ReturnType

Gets the return type of this method.

Declaration
public override Type ReturnType { get; }
Property Value
Type Description
Type
Overrides
MethodInfo.ReturnType
| Improve this Doc View Source

ReturnTypeCustomAttributes

Gets the custom attributes for the return type.

Declaration
public override ICustomAttributeProvider ReturnTypeCustomAttributes { get; }
Property Value
Type Description
ICustomAttributeProvider
Overrides
MethodInfo.ReturnTypeCustomAttributes

Methods

| Improve this Doc View Source

CreateDelegate(Type)

Creates a delegate of the specified type from this method.

Declaration
public override Delegate CreateDelegate(Type delegateType)
Parameters
Type Name Description
Type delegateType

The type of the delegate to create.

Returns
Type Description
Delegate

The delegate for this method.

Overrides
MethodInfo.CreateDelegate(Type)
| Improve this Doc View Source

CreateDelegate(Type, Object)

Creates a delegate of the specified type from this method.

Declaration
public override Delegate CreateDelegate(Type delegateType, object target)
Parameters
Type Name Description
Type delegateType

The type of the delegate to create.

Object target

The object targeted by the delegate.

Returns
Type Description
Delegate

The delegate for this method.

Overrides
MethodInfo.CreateDelegate(Type, Object)
| Improve this Doc View Source

Equals(Object)

Determines whether this method is equal to the given method.

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
Object other

Other constructor to compare.

Returns
Type Description
Boolean

true if this object reflects the same method as the specified object; otherwise, false.

Overrides
MethodInfo.Equals(Object)
| Improve this Doc View Source

Equals(MethodInfo)

Determines whether this method is equal to the given method.

Declaration
public bool Equals(MethodInfo other)
Parameters
Type Name Description
MethodInfo other

Other constructor to compare.

Returns
Type Description
Boolean

true if this object reflects the same method as the specified object; otherwise, false.

| Improve this Doc View Source

GetBaseDefinition()

Returns the method on the direct or indirect base class in which the method represented by this instance was first declared.

Declaration
public override MethodInfo GetBaseDefinition()
Returns
Type Description
MethodInfo

The first implementation of this method.

Overrides
MethodInfo.GetBaseDefinition()
| Improve this Doc View Source

GetCustomAttributes(Boolean)

Returns an array of all custom attributes applied to this method.

Declaration
public override object[] GetCustomAttributes(bool inherit)
Parameters
Type Name Description
Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Object[]

An array that contains all the custom attributes applied to this method.

Overrides
MemberInfo.GetCustomAttributes(Boolean)
| Improve this Doc View Source

GetCustomAttributes(Type, Boolean)

Returns an array of all custom attributes applied to this method.

Declaration
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
Type Name Description
Type attributeType

The type of attribute to search for. Only attributes that are assignable to this type are returned.

Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Object[]

An array that contains all the custom attributes applied to this method.

Overrides
MemberInfo.GetCustomAttributes(Type, Boolean)
| Improve this Doc View Source

GetCustomAttributesData()

Returns a list of custom attributes that have been applied to the target method.

Declaration
public override IList<CustomAttributeData> GetCustomAttributesData()
Returns
Type Description
IList<CustomAttributeData>

The data about the attributes that have been applied to the target method.

Overrides
MemberInfo.GetCustomAttributesData()
| Improve this Doc View Source

GetGenericArguments()

Returns the type arguments of a generic method or the type parameters of a generic method definition.

Declaration
public override Type[] GetGenericArguments()
Returns
Type Description
Type[]

The list of generic arguments.

Overrides
MethodInfo.GetGenericArguments()
| Improve this Doc View Source

GetGenericMethodDefinition()

Returns generic method definition from which the current method can be constructed.

Declaration
public override MethodInfo GetGenericMethodDefinition()
Returns
Type Description
MethodInfo

Generic method definition from which the current method can be constructed.

Overrides
MethodInfo.GetGenericMethodDefinition()
| Improve this Doc View Source

GetHashCode()

Computes hash code uniquely identifies the reflected method.

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

The hash code of the method.

Overrides
MethodInfo.GetHashCode()
| Improve this Doc View Source

GetMethodBody()

Provides access to the MSIL stream, local variables, and exceptions for the current method.

Declaration
public override MethodBody GetMethodBody()
Returns
Type Description
MethodBody

An object that provides access to the MSIL stream, local variables, and exceptions for the current method.

Overrides
MethodBase.GetMethodBody()
| Improve this Doc View Source

GetMethodImplementationFlags()

Gets method implementation attributes.

Declaration
public override MethodImplAttributes GetMethodImplementationFlags()
Returns
Type Description
MethodImplAttributes

Implementation attributes.

Overrides
MethodBase.GetMethodImplementationFlags()
| Improve this Doc View Source

GetParameters()

Gets method parameters.

Declaration
public override ParameterInfo[] GetParameters()
Returns
Type Description
ParameterInfo[]

The array of method parameters.

Overrides
MethodBase.GetParameters()
| Improve this Doc View Source

Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

Invokes this method.

Declaration
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Parameters
Type Name Description
Object obj

The object on which to invoke the method.

BindingFlags invokeAttr

Specifies the type of binding.

Binder binder

Defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection.

Object[] parameters

A list of method arguments.

CultureInfo culture

Used to govern the coercion of types.

Returns
Type Description
Object

The return value of the invoked method.

Overrides
MethodBase.Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
| Improve this Doc View Source

IsDefined(Type, Boolean)

Determines whether one or more attributes of the specified type or of its derived types is applied to this method.

Declaration
public override bool IsDefined(Type attributeType, bool inherit)
Parameters
Type Name Description
Type attributeType

The type of custom attribute to search for. The search includes derived types.

Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Boolean

true if one or more instances of attributeType or any of its derived types is applied to this method; otherwise, false.

Overrides
MemberInfo.IsDefined(Type, Boolean)
| Improve this Doc View Source

MakeGenericMethod(Type[])

Substitutes the elements of an array of types for the type parameters of the current generic method definition, and returns the resulting constructed method.

Declaration
public override MethodInfo MakeGenericMethod(params Type[] typeArguments)
Parameters
Type Name Description
Type[] typeArguments

An array of types to be substituted for the type parameters of the current generic method definition.

Returns
Type Description
MethodInfo

The constructed method formed by substituting the elements of typeArguments for the type parameters of the current generic method definition.

Overrides
MethodInfo.MakeGenericMethod(Type[])
| Improve this Doc View Source

ToString()

Returns textual representation of this method.

Declaration
public override string ToString()
Returns
Type Description
String

The textual representation of this method.

Overrides
Object.ToString()

Operators

| Improve this Doc View Source

Implicit(Method<TSignature> to TSignature)

Gets a delegate representing this method.

Declaration
public static implicit operator TSignature(Method<TSignature> method)
Parameters
Type Name Description
Method<TSignature> method

The reflected method.

Returns
Type Description
TSignature

Explicit Interface Implementations

| Improve this Doc View Source

IMember<MethodInfo, TSignature>.Invoker

Declaration
TSignature IMember<MethodInfo, TSignature>.Invoker { get; }
Returns
Type Description
TSignature
| Improve this Doc View Source

IMember<MethodInfo>.RuntimeMember

Declaration
MethodInfo IMember<MethodInfo>.RuntimeMember { get; }
Returns
Type Description
MethodInfo

Implements

IMethod<TSignature>
IMethod<TMethod, TSignature>
IMember<TMember, TInvoker>
IMember<TMember>
System.Reflection.ICustomAttributeProvider
System.IConvertible<>
System.IEquatable<T>

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
DelegateHelpers.CreateDelegate<TDelegate>(MethodInfo, Object)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
CustomAttribute.IsDefined<TAttribute>(ICustomAttributeProvider, Boolean)
MethodExtensions.GetParameterTypes(MethodBase)
MethodExtensions.SignatureEquals(MethodBase, Type[])
MethodExtensions.SignatureEquals(MethodBase, MethodBase, Boolean)
MethodExtensions.SignatureEquals(MethodInfo, MethodInfo, Boolean)
MethodExtensions.TryInvoke(MethodBase, Object, Object[])
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
Reflector.Unreflect<TDelegate>(MethodInfo)
Reflector.Unreflect(MethodInfo)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX