Class HarmonyPatch
Annotation to define your Harmony patch methods
Inherited Members
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 SourceHarmonyPatch()
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
Type | Name | Description |
---|---|---|
MethodType | methodType | 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
Type | Name | Description |
---|---|---|
MethodType | methodType | 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
Type | Name | Description |
---|---|---|
MethodType | methodType | 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
Type | Name | Description |
---|---|---|
System.String | methodName | 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
Type | Name | Description |
---|---|---|
System.String | methodName | 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
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |