Show / Hide Table of Contents

Class HarmonyPatch

Annotation to define your Harmony patch methods

Inheritance
System.Object
System.Attribute
HarmonyAttribute
HarmonyPatch
HarmonyDelegate
Inherited Members
HarmonyAttribute.info
Namespace: HarmonyLib
Assembly: 0Harmony.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Delegate, AllowMultiple = true)]
public class HarmonyPatch : HarmonyAttribute, _Attribute

Constructors

| Improve this Doc View Source

HarmonyPatch()

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

Declaration
public HarmonyPatch()
| Improve this Doc View Source

HarmonyPatch(MethodType)

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

Declaration
public HarmonyPatch(MethodType methodType)
Parameters
Type Name Description
MethodType methodType

The MethodType

| Improve this Doc View Source

HarmonyPatch(MethodType, Type[])

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

Declaration
public HarmonyPatch(MethodType methodType, params Type[] argumentTypes)
Parameters
Type Name Description
MethodType methodType

The MethodType

System.Type[] argumentTypes

An array of argument types to target overloads

| Improve this Doc View Source

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

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

Declaration
public HarmonyPatch(MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
Parameters
Type Name Description
MethodType methodType

The MethodType

System.Type[] argumentTypes

An array of argument types to target overloads

ArgumentType[] argumentVariations

An array of ArgumentType

| Improve this Doc View Source

HarmonyPatch(String)

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

Declaration
public HarmonyPatch(string methodName)
Parameters
Type Name Description
System.String methodName

The name of the method, property or constructor to patch

| Improve this Doc View Source

HarmonyPatch(String, MethodType)

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

Declaration
public HarmonyPatch(string methodName, MethodType methodType)
Parameters
Type Name Description
System.String methodName

The name of the method, property or constructor to patch

MethodType methodType

The MethodType

| Improve this Doc View Source

HarmonyPatch(String, String, MethodType)

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

Declaration
public HarmonyPatch(string typeName, string methodName, MethodType methodType = MethodType.Normal)
Parameters
Type Name Description
System.String typeName

The full name of the declaring class/type

System.String methodName

The name of the method, property or constructor to patch

MethodType methodType

The MethodType

| Improve this Doc View Source

HarmonyPatch(String, Type[])

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

Declaration
public HarmonyPatch(string methodName, params Type[] argumentTypes)
Parameters
Type Name Description
System.String methodName

The name of the method, property or constructor to patch

System.Type[] argumentTypes

An array of argument types to target overloads

| Improve this Doc View Source

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

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

Declaration
public HarmonyPatch(string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
Parameters
Type Name Description
System.String methodName

The name of the method, property or constructor to patch

System.Type[] argumentTypes

An array of argument types to target overloads

ArgumentType[] argumentVariations

An array of ArgumentType

| Improve this Doc View Source

HarmonyPatch(Type)

An annotation that specifies a class to patch

Declaration
public HarmonyPatch(Type declaringType)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

| Improve this Doc View Source

HarmonyPatch(Type, MethodType)

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

Declaration
public HarmonyPatch(Type declaringType, MethodType methodType)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

MethodType methodType

The MethodType

| Improve this Doc View Source

HarmonyPatch(Type, MethodType, Type[])

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

Declaration
public HarmonyPatch(Type declaringType, MethodType methodType, params Type[] argumentTypes)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

MethodType methodType

The MethodType

System.Type[] argumentTypes

An array of argument types to target overloads

| Improve this Doc View Source

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

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

Declaration
public HarmonyPatch(Type declaringType, MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

MethodType methodType

The MethodType

System.Type[] argumentTypes

An array of argument types to target overloads

ArgumentType[] argumentVariations

Array of ArgumentType

| Improve this Doc View Source

HarmonyPatch(Type, String)

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

Declaration
public HarmonyPatch(Type declaringType, string methodName)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

System.String methodName

The name of the method, property or constructor to patch

| Improve this Doc View Source

HarmonyPatch(Type, String, MethodType)

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

Declaration
public HarmonyPatch(Type declaringType, string methodName, MethodType methodType)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

System.String methodName

The name of the method, property or constructor to patch

MethodType methodType

The MethodType

| Improve this Doc View Source

HarmonyPatch(Type, String, Type[])

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

Declaration
public HarmonyPatch(Type declaringType, string methodName, params Type[] argumentTypes)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

System.String methodName

The name of the method, property or constructor to patch

System.Type[] argumentTypes

An array of argument types to target overloads

| Improve this Doc View Source

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

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

Declaration
public HarmonyPatch(Type declaringType, string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

System.String methodName

The name of the method, property or constructor to patch

System.Type[] argumentTypes

An array of argument types to target overloads

ArgumentType[] argumentVariations

Array of ArgumentType

| Improve this Doc View Source

HarmonyPatch(Type, Type[])

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

Declaration
public HarmonyPatch(Type declaringType, Type[] argumentTypes)
Parameters
Type Name Description
System.Type declaringType

The declaring class/type

System.Type[] argumentTypes

The argument types of the method or constructor to patch

| Improve this Doc View Source

HarmonyPatch(Type[])

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

Declaration
public HarmonyPatch(Type[] argumentTypes)
Parameters
Type Name Description
System.Type[] argumentTypes

An array of argument types to target overloads

| Improve this Doc View Source

HarmonyPatch(Type[], ArgumentType[])

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

Declaration
public HarmonyPatch(Type[] argumentTypes, ArgumentType[] argumentVariations)
Parameters
Type Name Description
System.Type[] argumentTypes

An array of argument types to target overloads

ArgumentType[] argumentVariations

An array of ArgumentType

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX