Class MethodExtensions
Various extension methods for method reflection.
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class MethodExtensions : object
  Methods
| Improve this Doc View SourceGetParameterTypes(MethodBase)
Returns method parameter types respecting order of parameters.
Declaration
public static Type[] GetParameterTypes(this MethodBase method)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MethodBase | method | The method to reflect.  | 
      
Returns
| Type | Description | 
|---|---|
| Type[] | The array of parameter types.  | 
      
SignatureEquals(MethodBase, MethodBase, Boolean)
Determines whether formal parameters of both methods are equal by type.
Declaration
public static bool SignatureEquals(this MethodBase method, MethodBase other, bool respectCallingConvention = false)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MethodBase | method | The first method to compare.  | 
      
| MethodBase | other | The second method to compare.  | 
      
| Boolean | respectCallingConvention | true to check calling convention; false to ignore calling convention.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true, if both methods have the same number of formal parameters and parameters are equal by type; otherwise, false.  | 
      
SignatureEquals(MethodBase, Type[])
Determines whether the method parameters have the same set of types as in given array of types.
Declaration
public static bool SignatureEquals(this MethodBase method, Type[] parameters)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MethodBase | method | The method to check.  | 
      
| Type[] | parameters | The expected parameter types.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true, if the method parameters have the same set of types as types passed as array; otherwise, false.  | 
      
SignatureEquals(MethodInfo, MethodInfo, Boolean)
Determines whether formal parameters of both methods are equal by type and return types are also equal.
Declaration
public static bool SignatureEquals(this MethodInfo method, MethodInfo other, bool respectCallingConvention = false)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MethodInfo | method | The first method to compare.  | 
      
| MethodInfo | other | The second method to compare.  | 
      
| Boolean | respectCallingConvention | true to check calling convention; false to ignore calling convention.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true, if both methods have the same number of formal parameters, parameters are equal by type and return types are equal; otherwise, false.  |