Show / Hide Table of Contents

Class MethodInfoExtensions

Contains extensions for the MethodInfo class.

Inheritance
object
MethodInfoExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.dll
Syntax
public static class MethodInfoExtensions

Methods

| Edit this page View Source

IsOverride(MethodInfo)

Determines if the method overrides a base definition.

Declaration
public static bool IsOverride(this MethodInfo method)
Parameters
Type Name Description
MethodInfo method
Returns
Type Description
bool

true if the method overrides a base definition, false otherwise.

| Edit this page View Source

IsSignatureCompatible(MethodInfo, Type)

Checks that the signature of a method is compatible with the specified delegate.

Declaration
public static bool IsSignatureCompatible(this MethodInfo staticMethodInfo, Type @delegate)
Parameters
Type Name Description
MethodInfo staticMethodInfo

MethodInfo to check.

Type delegate

Type of the Delegate to check.

Returns
Type Description
bool

true if the method is compatible with the signature of the specified delegate, false otherwise.

| Edit this page View Source

IsSignatureCompatible<T>(MethodInfo)

Checks that the signature of a method is compatible with the delegate specified.

Declaration
public static bool IsSignatureCompatible<T>(this MethodInfo staticMethodInfo) where T : Delegate
Parameters
Type Name Description
MethodInfo staticMethodInfo

MethodInfo to check.

Returns
Type Description
bool

true if the method is compatible with the signature of the specified delegate, false otherwise.

Type Parameters
Name Description
T

Type of the Delegate to check.

| Edit this page View Source

IsVoid(MethodInfo)

Gets a value that determines if the method does not return values (if it is void).

Declaration
public static bool IsVoid(this MethodInfo m)
Parameters
Type Name Description
MethodInfo m

Method to check.

Returns
Type Description
bool

true if the method does not return values, false otherwise.

| Edit this page View Source

ToDelegate<T>(MethodInfo, object?)

Creates a delegate of the specified type from the method.

Declaration
public static T? ToDelegate<T>(this MethodInfo m, object? targetInstance = null) where T : notnull, Delegate
Parameters
Type Name Description
MethodInfo m

Method from which to obtain a delegate.

object targetInstance

Target instance to which to link the generated delegate, or null to generate a static method delegate.

Returns
Type Description
T

A delegate of the specified type from the method, or null if the conversion is not possible.

Type Parameters
Name Description
T

Type of delegate to obtain.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX