Skip to content
Concord

Enum At

Namespace
Concord
Assembly
Concord.Emit.dll

Public injection-position values for InjectAttribute and the fluent PatchBuilder. Maps to a InjectAt for composition.

public enum At

Fields

Argument = 5

Rewrite one argument of a matched call inside the target body through the injection method.

Around = 3

Wrap the whole target body.

Constant = 4

Replace an inlined literal constant in the target body with the injection method's return value.

Head = 0

Run the injection method at the head of the target (default).

Return = 1

Run the injection method before each return in the target body (or a single chosen return), reading and replacing the value returned at that site.

Tail = 2

Run the injection method once at the end of the target, just before the wrapper returns. This includes completion after a caught exception, but not an exception that escapes the target.

Transpiler = 6

Rewrite the target's original IL directly, before Concord composes any declarative injection onto it. The injection method must be static and takes and returns IEnumerable<CodeInstruction>, optionally with an ITranspilerContext second parameter.

A transpiler must be a pure function of its input body. Concord recomposes a target from its raw IL on every patch and every unpatch of that target, including when an unrelated mod unpatches it, so a transpiler runs an unpredictable number of times.

Adding or removing a ret, an inlined literal, or a call shifts the occurrences that other mods' At.Return(By:), At.Constant(By:) and At.Invoke(By:) injections select against. Concord does not detect this and reports no diagnostic; the failure surfaces in the other mod.

Order between transpilers from different mods is not currently stable. Set an explicit Priority when order matters.

TranspilerFinal = 7

Rewrite the fully composed wrapper IL, after every declarative injection is spliced in.

No stability guarantee. The composed body's shape is a Concord implementation detail and may change in ANY release, including patch releases. The body you receive contains Concord's protocol locals appended after the target's own, every original ret rewritten into a synthesized epilogue, and a cancel gate between head injections and the target body. Every caveat on Transpiler applies here too.