Table of Contents

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

source Expression<Action>
The source method.
target Expression<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

source Expression
The source method.
target Expression
The target method.

Hook(MethodBase, MethodInfo)

Constructs a Hook detouring source to target.
public Hook(MethodBase source, MethodInfo target)

Parameters

source MethodBase
The source method.
target MethodInfo
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

source Expression<Action>
The source method.
target Expression<Action>
The target method.
applyByDefault bool
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

source Expression
The source method.
target Expression
The target method.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.

Hook(MethodBase, MethodInfo, bool)

Constructs a Hook detouring source to target.
public Hook(MethodBase source, MethodInfo target, bool applyByDefault)

Parameters

source MethodBase
The source method.
target MethodInfo
The target method.
applyByDefault bool
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

source Expression<Action>
The source method.
target Expression<Action>
The target method.
config DetourConfig
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

source Expression
The source method.
target Expression
The target method.
config DetourConfig
The DetourConfig to use for this Hook.

Hook(MethodBase, MethodInfo, DetourConfig?)

Constructs a Hook detouring source to target, using the provided DetourConfig.
public Hook(MethodBase source, MethodInfo target, DetourConfig? config)

Parameters

source MethodBase
The source method.
target MethodInfo
The target method.
config DetourConfig
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

source Expression<Action>
The source method.
target Expression<Action>
The target method.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source Expression
The source method.
target Expression
The target method.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.

Hook(MethodBase, MethodInfo, DetourConfig?, bool)

Constructs a Hook detouring source to target, using the provided DetourConfig.
public Hook(MethodBase source, MethodInfo target, DetourConfig? config, bool applyByDefault)

Parameters

source MethodBase
The source method.
target MethodInfo
The target method.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.

Hook(MethodBase, MethodInfo, IDetourFactory, DetourConfig?, bool)

Constructs a Hook detouring source to target, using the provided DetourConfig and IDetourFactory.
public Hook(MethodBase source, MethodInfo target, IDetourFactory factory, DetourConfig? config, bool applyByDefault)

Parameters

source MethodBase
The source method.
target MethodInfo
The target method.
factory IDetourFactory
The IDetourFactory to use when manipulating this Hook.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source Expression<Action>
The source method.
target Expression<Action>
The target method.
targetObj object
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

source Expression
The source method.
target Expression
The target method.
targetObj object
The this object to call the target method on.

Hook(MethodBase, MethodInfo, object?)

Constructs a Hook detouring source to target, calling target on targetObj.
public Hook(MethodBase source, MethodInfo target, object? targetObj)

Parameters

source MethodBase
The source method.
target MethodInfo
The target method.
targetObj object
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

source Expression<Action>
The source method.
target Expression<Action>
The target method.
targetObj object
The this object to call the target method on.
applyByDefault bool
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

source Expression
The source method.
target Expression
The target method.
targetObj object
The this object to call the target method on.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.

Hook(MethodBase, MethodInfo, object?, bool)

Constructs a Hook detouring source to target, calling target on targetObj.
public Hook(MethodBase source, MethodInfo target, object? targetObj, bool applyByDefault)

Parameters

source MethodBase
The source method.
target MethodInfo
The target method.
targetObj object
The this object to call the target method on.
applyByDefault bool
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

source Expression<Action>
The source method.
target Expression<Action>
The target method.
targetObj object
The this object to call the target method on.
config DetourConfig
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

source Expression
The source method.
target Expression
The target method.
targetObj object
The this object to call the target method on.
config DetourConfig
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

source MethodBase
The source method.
target MethodInfo
The target method.
targetObj object
The this object to call the target method on.
config DetourConfig
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

source Expression<Action>
The source method.
target Expression<Action>
The target method.
targetObj object
The this object to call the target method on.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source Expression
The source method.
target Expression
The target method.
targetObj object
The this object to call the target method on.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source MethodBase
The source method.
target MethodInfo
The target method.
targetObj object
The this object to call the target method on.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source Expression<Action>
The method to detour.
target Delegate
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

source Expression
The method to detour.
target Delegate
The target delegate.

Hook(MethodBase, Delegate)

Constructs a Hook detouring the provided method to the provided delegate.
public Hook(MethodBase source, Delegate target)

Parameters

source MethodBase
The method to detour.
target Delegate
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

source Expression<Action>
The method to detour.
target Delegate
The target delegate.
applyByDefault bool
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

source Expression
The method to detour.
target Delegate
The target delegate.
applyByDefault bool
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

source MethodBase
The method to detour.
target Delegate
The target delegate.
applyByDefault bool
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

source Expression<Action>
The method to detour.
target Delegate
The target delegate.
config DetourConfig
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

source Expression
The method to detour.
target Delegate
The target delegate.
config DetourConfig
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

source MethodBase
The method to detour.
target Delegate
The target delegate.
config DetourConfig
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

source Expression<Action>
The method to detour.
target Delegate
The target delegate.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source Expression
The method to detour.
target Delegate
The target delegate.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source MethodBase
The method to detour.
target Delegate
The target delegate.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source MethodBase
The method to detour.
target Delegate
The target delegate.
factory IDetourFactory
The IDetourFactory to use when manipulating this Hook.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
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

source MethodBase
The source method.
target MethodInfo
The target method.
targetObject object
The this object to call the target method on.
factory IDetourFactory
The IDetourFactory to use when manipulating this Hook.
config DetourConfig
The DetourConfig to use for this Hook.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.