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 SourceGetMethodInfo(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 |
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 |
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 |
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 |