Browse documentation

Class HarmonyPatch

Namespace
HarmonyLib
Assembly
0Harmony.dll

Annotation to define your Harmony patch methods

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Method|AttributeTargets.Delegate, AllowMultiple = true)]
public class HarmonyPatch : HarmonyAttribute
Inheritance
object
Attribute
HarmonyPatch
Derived
Inherited Members

Constructors

HarmonyPatch()

An empty annotation can be used together with TargetMethod(s)

public HarmonyPatch()

HarmonyPatch(MethodType)

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(MethodType methodType)

Parameters

methodType MethodType

The MethodType

HarmonyPatch(MethodType, params Type[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(MethodType methodType, params Type[] argumentTypes)

Parameters

methodType MethodType

The MethodType

argumentTypes Type[]

An array of argument types to target overloads

HarmonyPatch(MethodType, Type[], ArgumentType[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)

Parameters

methodType MethodType

The MethodType

argumentTypes Type[]

An array of argument types to target overloads

argumentVariations ArgumentType[]

An array of ArgumentType

HarmonyPatch(string)

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(string methodName)

Parameters

methodName string

The name of the method, property or constructor to patch

HarmonyPatch(string, MethodType)

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(string methodName, MethodType methodType)

Parameters

methodName string

The name of the method, property or constructor to patch

methodType MethodType

The MethodType

HarmonyPatch(string, string, MethodType)

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(string typeName, string methodName, MethodType methodType = MethodType.Normal)

Parameters

typeName string

The full name of the declaring class/type

methodName string

The name of the method, property or constructor to patch

methodType MethodType

The MethodType

HarmonyPatch(string, params Type[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(string methodName, params Type[] argumentTypes)

Parameters

methodName string

The name of the method, property or constructor to patch

argumentTypes Type[]

An array of argument types to target overloads

HarmonyPatch(string, Type[], ArgumentType[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)

Parameters

methodName string

The name of the method, property or constructor to patch

argumentTypes Type[]

An array of argument types to target overloads

argumentVariations ArgumentType[]

An array of ArgumentType

HarmonyPatch(Type)

An annotation that specifies a class to patch

public HarmonyPatch(Type declaringType)

Parameters

declaringType Type

The declaring class/type

HarmonyPatch(Type, MethodType)

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, MethodType methodType)

Parameters

declaringType Type

The declaring class/type

methodType MethodType

The MethodType

HarmonyPatch(Type, MethodType, params Type[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, MethodType methodType, params Type[] argumentTypes)

Parameters

declaringType Type

The declaring class/type

methodType MethodType

The MethodType

argumentTypes Type[]

An array of argument types to target overloads

HarmonyPatch(Type, MethodType, Type[], ArgumentType[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)

Parameters

declaringType Type

The declaring class/type

methodType MethodType

The MethodType

argumentTypes Type[]

An array of argument types to target overloads

argumentVariations ArgumentType[]

Array of ArgumentType

HarmonyPatch(Type, string)

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, string methodName)

Parameters

declaringType Type

The declaring class/type

methodName string

The name of the method, property or constructor to patch

HarmonyPatch(Type, string, MethodType)

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, string methodName, MethodType methodType)

Parameters

declaringType Type

The declaring class/type

methodName string

The name of the method, property or constructor to patch

methodType MethodType

The MethodType

HarmonyPatch(Type, string, params Type[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, string methodName, params Type[] argumentTypes)

Parameters

declaringType Type

The declaring class/type

methodName string

The name of the method, property or constructor to patch

argumentTypes Type[]

An array of argument types to target overloads

HarmonyPatch(Type, string, Type[], ArgumentType[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)

Parameters

declaringType Type

The declaring class/type

methodName string

The name of the method, property or constructor to patch

argumentTypes Type[]

An array of argument types to target overloads

argumentVariations ArgumentType[]

Array of ArgumentType

HarmonyPatch(Type, Type[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type declaringType, Type[] argumentTypes)

Parameters

declaringType Type

The declaring class/type

argumentTypes Type[]

The argument types of the method or constructor to patch

HarmonyPatch(Type[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type[] argumentTypes)

Parameters

argumentTypes Type[]

An array of argument types to target overloads

HarmonyPatch(Type[], ArgumentType[])

An annotation that specifies a method, property or constructor to patch

public HarmonyPatch(Type[] argumentTypes, ArgumentType[] argumentVariations)

Parameters

argumentTypes Type[]

An array of argument types to target overloads

argumentVariations ArgumentType[]

An array of ArgumentType

Harmony 3 preview

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