Enum ArgumentMode
- Namespace
- HarmonyLib
- Assembly
- 0Harmony.dll
Specifies how Harmony resolves an argument name
public enum ArgumentMode
Fields
Captured = 2Match 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 = 0Use Harmony's default argument name handling
Original = 1Match an original method argument by its exact name
Persistent = 3Bind 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.