Constructor Hook
- Namespace
- MonoMod.RuntimeDetour
- Assembly
- MonoMod.RuntimeDetour.dll
Hook(Expression<Action>, Expression<Action>)
Constructs a Hook using the methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
Hook(Expression, Expression)
Constructs a Hook using the methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
Hook(MethodBase, MethodInfo)
public Hook(MethodBase source, MethodInfo target)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
Hook(Expression<Action>, Expression<Action>, bool)
Constructs a Hook using the methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target, bool applyByDefault)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression, Expression, bool)
Constructs a Hook using the methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target, bool applyByDefault)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, MethodInfo, bool)
public Hook(MethodBase source, MethodInfo target, bool applyByDefault)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression<Action>, Expression<Action>, DetourConfig?)
Constructs a Hook using the provided DetourConfig and methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target, DetourConfig? config)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(Expression, Expression, DetourConfig?)
Constructs a Hook using the provided DetourConfig and methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target, DetourConfig? config)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(MethodBase, MethodInfo, DetourConfig?)
public Hook(MethodBase source, MethodInfo target, DetourConfig? config)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(Expression<Action>, Expression<Action>, DetourConfig?, bool)
Constructs a Hook using the provided DetourConfig and methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target, DetourConfig? config, bool applyByDefault)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression, Expression, DetourConfig?, bool)
Constructs a Hook using the provided DetourConfig and methods specified by expression trees. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target, DetourConfig? config, bool applyByDefault)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, MethodInfo, DetourConfig?, bool)
public Hook(MethodBase source, MethodInfo target, DetourConfig? config, bool applyByDefault)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, MethodInfo, IDetourFactory, DetourConfig?, bool)
public Hook(MethodBase source, MethodInfo target, IDetourFactory factory, DetourConfig? config, bool applyByDefault)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
factoryIDetourFactory- The IDetourFactory to use when manipulating this Hook.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression<Action>, Expression<Action>, object?)
Constructs a Hook using the methods specified by expression trees, and specified target object. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target, object? targetObj)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
targetObjobject- The this object to call the target method on.
Hook(Expression, Expression, object?)
Constructs a Hook using the methods specified by expression trees, and specified target object. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target, object? targetObj)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
targetObjobject- The this object to call the target method on.
Hook(MethodBase, MethodInfo, object?)
public Hook(MethodBase source, MethodInfo target, object? targetObj)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
targetObjobject- The this object to call the target method on.
Hook(Expression<Action>, Expression<Action>, object?, bool)
Constructs a Hook using the methods specified by expression trees, and specified target object. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target, object? targetObj, bool applyByDefault)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
targetObjobject- The this object to call the target method on.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression, Expression, object?, bool)
Constructs a Hook using the methods specified by expression trees, and specified target object. Each expression tree must consist only of
a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target, object? targetObj, bool applyByDefault)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
targetObjobject- The this object to call the target method on.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, MethodInfo, object?, bool)
public Hook(MethodBase source, MethodInfo target, object? targetObj, bool applyByDefault)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
targetObjobject- The this object to call the target method on.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression<Action>, Expression<Action>, object?, DetourConfig?)
Constructs a Hook using the provided DetourConfig, methods specified by expression trees, and specified target object.
Each expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target, object? targetObj, DetourConfig? config)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
targetObjobject- The this object to call the target method on.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(Expression, Expression, object?, DetourConfig?)
Constructs a Hook using the provided DetourConfig, methods specified by expression trees, and specified target object.
Each expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target, object? targetObj, DetourConfig? config)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
targetObjobject- The this object to call the target method on.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(MethodBase, MethodInfo, object?, DetourConfig?)
Constructs a Hook detouring
source to target, calling target on targetObj,
using the provided DetourConfig..public Hook(MethodBase source, MethodInfo target, object? targetObj, DetourConfig? config)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
targetObjobject- The this object to call the target method on.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(Expression<Action>, Expression<Action>, object?, DetourConfig?, bool)
Constructs a Hook using the provided DetourConfig, methods specified by expression trees, and specified target object.
Each expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Expression<Action> target, object? targetObj, DetourConfig? config, bool applyByDefault)
Parameters
sourceExpression<Action>- The source method.
targetExpression<Action>- The target method.
targetObjobject- The this object to call the target method on.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression, Expression, object?, DetourConfig?, bool)
Constructs a Hook using the provided DetourConfig, methods specified by expression trees, and specified target object.
Each expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Expression target, object? targetObj, DetourConfig? config, bool applyByDefault)
Parameters
sourceExpression- The source method.
targetExpression- The target method.
targetObjobject- The this object to call the target method on.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, MethodInfo, object?, DetourConfig?, bool)
Constructs a Hook detouring
source to target, calling target on targetObj,
using the provided DetourConfig.public Hook(MethodBase source, MethodInfo target, object? targetObj, DetourConfig? config, bool applyByDefault)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
targetObjobject- The this object to call the target method on.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression<Action>, Delegate)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Delegate target)
Parameters
sourceExpression<Action>- The method to detour.
targetDelegate- The target delegate.
Hook(Expression, Delegate)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Delegate target)
Parameters
sourceExpression- The method to detour.
targetDelegate- The target delegate.
Hook(MethodBase, Delegate)
Constructs a Hook detouring the provided method to the provided delegate.
public Hook(MethodBase source, Delegate target)
Parameters
sourceMethodBase- The method to detour.
targetDelegate- The target delegate.
Hook(Expression<Action>, Delegate, bool)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Delegate target, bool applyByDefault)
Parameters
sourceExpression<Action>- The method to detour.
targetDelegate- The target delegate.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression, Delegate, bool)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Delegate target, bool applyByDefault)
Parameters
sourceExpression- The method to detour.
targetDelegate- The target delegate.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, Delegate, bool)
Constructs a Hook detouring the provided method to the provided delegate.
public Hook(MethodBase source, Delegate target, bool applyByDefault)
Parameters
sourceMethodBase- The method to detour.
targetDelegate- The target delegate.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression<Action>, Delegate, DetourConfig?)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Delegate target, DetourConfig? config)
Parameters
sourceExpression<Action>- The method to detour.
targetDelegate- The target delegate.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(Expression, Delegate, DetourConfig?)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Delegate target, DetourConfig? config)
Parameters
sourceExpression- The method to detour.
targetDelegate- The target delegate.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(MethodBase, Delegate, DetourConfig?)
Constructs a Hook detouring the provided method to the provided delegate, using the provided DetourConfig.
public Hook(MethodBase source, Delegate target, DetourConfig? config)
Parameters
sourceMethodBase- The method to detour.
targetDelegate- The target delegate.
configDetourConfig- The DetourConfig to use for this Hook.
Hook(Expression<Action>, Delegate, DetourConfig?, bool)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression<Action> source, Delegate target, DetourConfig? config, bool applyByDefault)
Parameters
sourceExpression<Action>- The method to detour.
targetDelegate- The target delegate.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(Expression, Delegate, DetourConfig?, bool)
Constructs a Hook detouring the method specified by the provided expression tree to the provided delegate.
The expression tree must consist only of a single methodcall, which will be the method used for that parameter.
public Hook(Expression source, Delegate target, DetourConfig? config, bool applyByDefault)
Parameters
sourceExpression- The method to detour.
targetDelegate- The target delegate.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, Delegate, DetourConfig?, bool)
Constructs a Hook detouring the provided method to the provided delegate, using the provided DetourConfig.
public Hook(MethodBase source, Delegate target, DetourConfig? config, bool applyByDefault)
Parameters
sourceMethodBase- The method to detour.
targetDelegate- The target delegate.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, Delegate, IDetourFactory, DetourConfig?, bool)
Constructs a Hook detouring the provided method to the provided delegate, using the provided DetourConfig
and IDetourFactory.
public Hook(MethodBase source, Delegate target, IDetourFactory factory, DetourConfig? config, bool applyByDefault)
Parameters
sourceMethodBase- The method to detour.
targetDelegate- The target delegate.
factoryIDetourFactory- The IDetourFactory to use when manipulating this Hook.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.
Hook(MethodBase, MethodInfo, object?, IDetourFactory, DetourConfig?, bool)
Constructs a Hook using the specified source and target methods, specified target object, specified IDetourFactory and DetourConfig,
specifying whether or not the hook should be applied when the constructor exits.
public Hook(MethodBase source, MethodInfo target, object? targetObject, IDetourFactory factory, DetourConfig? config, bool applyByDefault)
Parameters
sourceMethodBase- The source method.
targetMethodInfo- The target method.
targetObjectobject- The this object to call the target method on.
factoryIDetourFactory- The IDetourFactory to use when manipulating this Hook.
configDetourConfig- The DetourConfig to use for this Hook.
applyByDefaultbool- Whether or not this hook should be applied when the constructor finishes.