Browse documentation

Class HarmonyArgument

Namespace
HarmonyLib
Assembly
0Harmony.dll

A Harmony annotation

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Method|AttributeTargets.Parameter, AllowMultiple = true)]
public class HarmonyArgument : Attribute
Inheritance
object
Attribute
HarmonyArgument

Constructors

HarmonyArgument(int)

An annotation to declare injected arguments by index

public HarmonyArgument(int index)

Parameters

index int

Zero-based index

HarmonyArgument(int, string)

An annotation to declare injected arguments by index and renaming them

public HarmonyArgument(int index, string name)

Parameters

index int

Zero-based index

name string

New name

HarmonyArgument(string)

An annotation to declare injected arguments by name

public HarmonyArgument(string originalName)

Parameters

originalName string

HarmonyArgument(string, ArgumentMode)

Binds an argument using the selected name handling

public HarmonyArgument(string originalName, ArgumentMode mode)

Parameters

originalName string

Name of the original argument

mode ArgumentMode

How Harmony resolves the argument name

HarmonyArgument(string, string)

An annotation to declare injected arguments by renaming them

public HarmonyArgument(string originalName, string newName)

Parameters

originalName string

Name of the original argument

newName string

New name

Properties

Index

The index of the original argument

public int Index { get; }

Property Value

int

NewName

The new name of the original argument

public string NewName { get; }

Property Value

string

OriginalName

The name of the original argument

public string OriginalName { get; }

Property Value

string
Harmony 3 preview

For the stable release, read the 2.x documentation.