Show / Hide Table of Contents

Class SymbolExtensions

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

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

Methods

| Improve this Doc View Source

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
System.Linq.Expressions.Expression<System.Action> expression

The lambda expression using the method

Returns
Type Description
System.Reflection.MethodInfo

The method in the lambda expression

| Improve this Doc View Source

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
System.Linq.Expressions.LambdaExpression expression

The lambda expression using the method

Returns
Type Description
System.Reflection.MethodInfo

The method in the lambda expression

| Improve this Doc View Source

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
System.Linq.Expressions.Expression<System.Action<T>> expression

The lambda expression using the method

Returns
Type Description
System.Reflection.MethodInfo

The method in the lambda expression

Type Parameters
Name Description
T

The generic type

| Improve this Doc View Source

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
System.Linq.Expressions.Expression<System.Func<T, TResult>> expression

The lambda expression using the method

Returns
Type Description
System.Reflection.MethodInfo

The method in the lambda expression

Type Parameters
Name Description
T

The generic type

TResult

The generic result type

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX