Back to Harmony

Class HarmonyPatch

docs/api/HarmonyLib.HarmonyPatch.html

2.4.2.010.1 KB
Original Source

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.Struct | AttributeTargets.Method | AttributeTargets.Delegate, AllowMultiple = true)]
public class HarmonyPatch : HarmonyAttribute, _Attribute

Constructors

HarmonyPatch()

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

Declaration
public HarmonyPatch()

HarmonyPatch(MethodType)

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

Declaration
public HarmonyPatch(MethodType methodType)
Parameters
TypeNameDescription
MethodTypemethodType

The MethodType

|

HarmonyPatch(MethodType, Type[])

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

Declaration
public HarmonyPatch(MethodType methodType, params Type[] argumentTypes)
Parameters
TypeNameDescription
MethodTypemethodType

The MethodType

| | System.Type[] | argumentTypes |

An array of argument types to target overloads

|

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
TypeNameDescription
MethodTypemethodType

The MethodType

| | System.Type[] | argumentTypes |

An array of argument types to target overloads

| | ArgumentType[] | argumentVariations |

An array of ArgumentType

|

HarmonyPatch(String)

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

Declaration
public HarmonyPatch(string methodName)
Parameters
TypeNameDescription
System.StringmethodName

The name of the method, property or constructor to patch

|

HarmonyPatch(String, MethodType)

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

Declaration
public HarmonyPatch(string methodName, MethodType methodType)
Parameters
TypeNameDescription
System.StringmethodName

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

Declaration
public HarmonyPatch(string typeName, string methodName, MethodType methodType = MethodType.Normal)
Parameters
TypeNameDescription
System.StringtypeName

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

|

HarmonyPatch(String, Type[])

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

Declaration
public HarmonyPatch(string methodName, params Type[] argumentTypes)
Parameters
TypeNameDescription
System.StringmethodName

The name of the method, property or constructor to patch

| | System.Type[] | argumentTypes |

An array of argument types to target overloads

|

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
TypeNameDescription
System.StringmethodName

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

|

HarmonyPatch(Type)

An annotation that specifies a class to patch

Declaration
public HarmonyPatch(Type declaringType)
Parameters
TypeNameDescription
System.TypedeclaringType

The declaring class/type

|

HarmonyPatch(Type, MethodType)

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

Declaration
public HarmonyPatch(Type declaringType, MethodType methodType)
Parameters
TypeNameDescription
System.TypedeclaringType

The declaring class/type

| | MethodType | methodType |

The MethodType

|

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
TypeNameDescription
System.TypedeclaringType

The declaring class/type

| | MethodType | methodType |

The MethodType

| | System.Type[] | argumentTypes |

An array of argument types to target overloads

|

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
TypeNameDescription
System.TypedeclaringType

The declaring class/type

| | MethodType | methodType |

The MethodType

| | System.Type[] | argumentTypes |

An array of argument types to target overloads

| | ArgumentType[] | argumentVariations |

Array of ArgumentType

|

HarmonyPatch(Type, String)

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

Declaration
public HarmonyPatch(Type declaringType, string methodName)
Parameters
TypeNameDescription
System.TypedeclaringType

The declaring class/type

| | System.String | methodName |

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

Declaration
public HarmonyPatch(Type declaringType, string methodName, MethodType methodType)
Parameters
TypeNameDescription
System.TypedeclaringType

The declaring class/type

| | System.String | methodName |

The name of the method, property or constructor to patch

| | MethodType | methodType |

The MethodType

|

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
TypeNameDescription
System.TypedeclaringType

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

|

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
TypeNameDescription
System.TypedeclaringType

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

|

HarmonyPatch(Type, Type[])

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

Declaration
public HarmonyPatch(Type declaringType, Type[] argumentTypes)
Parameters
TypeNameDescription
System.TypedeclaringType

The declaring class/type

| | System.Type[] | argumentTypes |

The argument types of the method or constructor to patch

|

HarmonyPatch(Type[])

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

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

An array of argument types to target overloads

|

HarmonyPatch(Type[], ArgumentType[])

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

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

An array of argument types to target overloads

| | ArgumentType[] | argumentVariations |

An array of ArgumentType

|