docs/api/HarmonyLib.SymbolExtensions.html
A helper class to retrieve reflection info for non-private methods
System.Object
SymbolExtensions
public static class SymbolExtensions
Given a lambda expression that calls a method, returns the method info
public static MethodInfo GetMethodInfo(Expression<Action> expression)
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression\ | expression |
The lambda expression using the method
|
| Type | Description |
|---|---|
| System.Reflection.MethodInfo |
The method in the lambda expression
|
Given a lambda expression that calls a method, returns the method info
public static MethodInfo GetMethodInfo(LambdaExpression expression)
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.LambdaExpression | expression |
The lambda expression using the method
|
| Type | Description |
|---|---|
| System.Reflection.MethodInfo |
The method in the lambda expression
|
Given a lambda expression that calls a method, returns the method info
public static MethodInfo GetMethodInfo<T>(Expression<Action<T>> expression)
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression\> | expression |
The lambda expression using the method
|
| Type | Description |
|---|---|
| System.Reflection.MethodInfo |
The method in the lambda expression
|
| Name | Description |
|---|---|
| T |
The generic type
|
Given a lambda expression that calls a method, returns the method info
public static MethodInfo GetMethodInfo<T, TResult>(Expression<Func<T, TResult>> expression)
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression\> | expression |
The lambda expression using the method
|
| Type | Description |
|---|---|
| System.Reflection.MethodInfo |
The method in the lambda expression
|
| Name | Description |
|---|---|
| T |
The generic type
| | TResult |
The generic result type
|