Browse documentation

Enum ArgumentMode

Namespace
HarmonyLib
Assembly
0Harmony.dll

Specifies how Harmony resolves an argument name

public enum ArgumentMode

Fields

Captured = 2

Match a preserved compiler-generated captured variable in an Infix scope

Lookup is case-sensitive and reads the inner generated receiver or closure arguments. Add HarmonyOuter for variables of the outer generated body. Optimized-away variables cannot be found.

Default = 0

Use Harmony's default argument name handling

Original = 1

Match an original method argument by its exact name

Persistent = 3

Bind a named, patch-owned outer value that survives awaits and iterator yields

Requires HarmonyOuter on an Infix parameter. Slots are scoped to the actual patch declaring type and name, start at default, and last one async execution or enumeration. Ordinary methods use one invocation. Values must be storable on the managed heap. Completion releases references without disposing stored objects. On the CLR 2.0 runtime of .NET 3.5, a stored value that refers back to its enumerator keeps both alive. Complete or dispose that enumerator, or remove the persistent patch.

Harmony 3

For Harmony 2, read the 2.x documentation.