Show / Hide Table of Contents

Class SymbolExtensions

A helper class to retrieve reflection info for non-private methods

Inheritance
object
SymbolExtensions
Namespace: HarmonyLib
Assembly: 0Harmony.dll
Syntax
public static class SymbolExtensions

Methods

GetMethodInfo(Expression<Action>)

Given a lambda expression that calls a method, returns the method info

Declaration
public static MethodInfo GetMethodInfo(Expression<Action> expression)
Parameters
Type Name Description
Expression<Action> expression

The lambda expression using the method

Returns
Type Description
MethodInfo

The method in the lambda expression

GetMethodInfo(LambdaExpression)

Given a lambda expression that calls a method, returns the method info

Declaration
public static MethodInfo GetMethodInfo(LambdaExpression expression)
Parameters
Type Name Description
LambdaExpression expression

The lambda expression using the method

Returns
Type Description
MethodInfo

The method in the lambda expression

GetMethodInfo<T>(Expression<Action<T>>)

Given a lambda expression that calls a method, returns the method info

Declaration
public static MethodInfo GetMethodInfo<T>(Expression<Action<T>> expression)
Parameters
Type Name Description
Expression<Action<T>> expression

The lambda expression using the method

Returns
Type Description
MethodInfo

The method in the lambda expression

Type Parameters
Name Description
T

The generic type

GetMethodInfo<T, TResult>(Expression<Func<T, TResult>>)

Given a lambda expression that calls a method, returns the method info

Declaration
public static MethodInfo GetMethodInfo<T, TResult>(Expression<Func<T, TResult>> expression)
Parameters
Type Name Description
Expression<Func<T, TResult>> expression

The lambda expression using the method

Returns
Type Description
MethodInfo

The method in the lambda expression

Type Parameters
Name Description
T

The generic type

TResult

The generic result type

In this article
Back to top Generated by DocFX