diff --git a/1.2/Assemblies/0Harmony.dll b/1.2/Assemblies/0Harmony.dll
index 947c81c..dcd061d 100644
Binary files a/1.2/Assemblies/0Harmony.dll and b/1.2/Assemblies/0Harmony.dll differ
diff --git a/1.2/Assemblies/0Harmony.xml b/1.2/Assemblies/0Harmony.xml
index 6bcea2e..b49cd79 100644
--- a/1.2/Assemblies/0Harmony.xml
+++ b/1.2/Assemblies/0Harmony.xml
@@ -131,11 +131,13 @@
- A low level memory helper
+ A low level memory helper
+
- Mark method for no inlining (currently only works on Mono)
- The method/constructor to change
+ Mark method for no inlining (currently only works on Mono)
+ The method/constructor to change
+
Detours a method
@@ -164,64 +166,6 @@
Patch function helpers
-
- Adds a prefix
- The patch info
- The owner (Harmony ID)
- The annotation info
-
-
-
- Removes a prefix
- The patch info
- The owner (Harmony ID)
-
-
-
- Adds a postfix
- The patch info
- The owner (Harmony ID)
- The annotation info
-
-
-
- Removes a postfix
- The patch info
- The owner (Harmony ID)
-
-
-
- Adds a transpiler
- The patch info
- The owner (Harmony ID)
- The annotation info
-
-
-
- Removes a transpiler
- The patch info
- The owner (Harmony ID)
-
-
-
- Adds a finalizer
- The patch info
- The owner (Harmony ID)
- The annotation info
-
-
-
- Removes a finalizer
- The patch info
- The owner (Harmony ID)
-
-
-
- Removes a patch method
- The patch info
- The patch method
-
-
Sorts patch methods by their priority rules
The original method
@@ -1302,80 +1246,84 @@
Finalizers as an array of
-
-
- Default constructor
-
Returns if any of the patches wants debugging turned on
-
- Adds a prefix
-
- The prefix method
+
+ Adds prefixes
An owner (Harmony ID)
- The priority, see
- A list of Harmony IDs for prefixes that should run after this prefix
- A list of Harmony IDs for prefixes that should run before this prefix
- A flag that will log the replacement method via every time this prefix is used to build the replacement, even in the future
+ The patch methods
+
+ Adds a prefix
+
Removes prefixes
- The owner of the prefix or * for any prefix
+ The owner of the prefixes, or * for all
-
- Adds a postfix
- The postfix method
+
+ Adds postfixes
An owner (Harmony ID)
- The priority, see
- A list of Harmony IDs for postfixes that should run after this postfix
- A list of Harmony IDs for postfixes that should run before this postfix
- A flag that will log the replacement method via every time this postfix is used to build the replacement, even in the future
+ The patch methods
+
+ Adds a postfix
+
Removes postfixes
- The owner of the postfix or * for any postfix
+ The owner of the postfixes, or * for all
-
- Adds a transpiler
- The transpiler method
+
+ Adds transpilers
An owner (Harmony ID)
- The priority, see
- A list of Harmony IDs for transpilers that should run after this transpiler
- A list of Harmony IDs for transpilers that should run before this transpiler
- A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future
+ The patch methods
+
+ Adds a transpiler
+
Removes transpilers
- The owner of the transpiler or * for any transpiler
+ The owner of the transpilers, or * for all
-
- Adds a finalizer
- The finalizer method
+
+ Adds finalizers
An owner (Harmony ID)
- The priority, see
- A list of Harmony IDs for finalizers that should run after this finalizer
- A list of Harmony IDs for finalizers that should run before this finalizer
- A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future
+ The patch methods
+
+ Adds a finalizer
+
Removes finalizers
- The owner of the finalizer or * for any finalizer
+ The owner of the finalizers, or * for all
Removes a patch using its method
The method of the patch to remove
+
+
+ Gets a concatenated list of patches
+ The Harmony instance ID adding the new patches
+ The patches to add
+ The current patches
+
+
+
+ Gets a list of patches with any from the given owner removed
+ The owner of the methods, or * for all
+ The current patches
+
A serializable patch
@@ -1420,6 +1368,12 @@
A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future
+
+ Creates a patch
+ The method of the patch
+ Zero-based index
+ An owner (Harmony ID)
+
Get the patch method or a DynamicMethod if original patch method is a patch factory
The original method/constructor
@@ -1707,7 +1661,7 @@
- A transpiler that replaces all occurrences of a given method with another one
+ A transpiler that replaces all occurrences of a given method with another one using the same signature
The enumeration of to act on
Method or constructor to search for
Method or constructor to replace with
@@ -1730,15 +1684,15 @@
- A helper class for reflection related functions
+ A helper class for reflection related functions
- Shortcut for to simplify the use of reflections and make it work for any access level
+ Shortcut for to simplify the use of reflections and make it work for any access level
- Shortcut for to simplify the use of reflections and make it work for any access level but only within the current type
+ Shortcut for to simplify the use of reflections and make it work for any access level but only within the current type
@@ -1748,30 +1702,35 @@
- Gets all successfully loaded types from a given assembly
- The assembly
- An array of types
-
- This calls and returns , while catching any thrown .
- If such an exception is thrown, returns the successfully loaded types (,
- filtered for non-null values).
-
+ Gets all successfully loaded types from a given assembly
+ The assembly
+ An array of types
+
+ This calls and returns , while catching any thrown .
+ If such an exception is thrown, returns the successfully loaded types (,
+ filtered for non-null values).
+
- Applies a function going up the type hierarchy and stops at the first non null result
+ Applies a function going up the type hierarchy and stops at the first non-null result
Result type of func()
The class/type to start with
The evaluation function returning T
- Returns the first non null result or default(T) when reaching the top level type object
+ The first non-null result, or null if no match
+
+ The type hierarchy of a class or value type (including struct) does NOT include implemented interfaces,
+ and the type hierarchy of an interface is only itself (regardless of whether that interface implements other interfaces).
+ The top-most type in the type hierarchy of all non-interface types (including value types) is .
+
- Applies a function going into inner types and stops at the first non null result
+ Applies a function going into inner types and stops at the first non-null result
Generic type parameter
The class/type to start with
The evaluation function returning T
- Returns the first non null result or null with no match
+ The first non-null result, or null if no match
@@ -2013,126 +1972,331 @@
- A read/writable reference to an instance field
- The class the field is defined in or "object" if type cannot be accessed at compile time
- The type of the field
- The runtime instance to access the field (leave empty for static fields)
- An readable/assignable object representing the field
+ A readable/assignable reference delegate to an instance field of a class or static field (NOT an instance field of a struct)
+
+ An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ),
+ implemented interface, or derived class of this type
+
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The runtime instance to access the field (ignored and can be omitted for static fields)
+ A readable/assignable reference to the field
+ Null instance passed to a non-static field ref delegate
+
+ Instance of invalid type passed to a non-static field ref delegate
+ (this can happen if is a parent class or interface of the field's declaring type)
+
+
+
+ This delegate cannot be used for instance fields of structs, since a struct instance passed to the delegate would be passed by
+ value and thus would be a copy that only exists within the delegate's invocation. This is fine for a readonly reference,
+ but makes assignment futile. Use instead.
+
+
+ Note that is not required to be the field's declaring type. It can be a parent class (including ),
+ implemented interface, or a derived class of the field's declaring type ("instanceOfT is FieldDeclaringType" must be possible).
+ Specifically, must be assignable from OR to the field's declaring type.
+ Technically, this allows Nullable, although Nullable is only relevant for structs, and since only static fields of structs
+ are allowed for this delegate, and the instance passed to such a delegate is ignored, this hardly matters.
+
+
+ Similarly, is not required to be the field's field type, unless that type is a value type.
+ It can be a parent class (including object) or implemented interface of the field's field type. It cannot be a derived class.
+ This variance is not allowed for value types, since that would require boxing/unboxing, which is not allowed for ref values.
+ Specifically, for reference types, must be assignable from
+ the field's field type; and for value types, must be exactly the field's field type.
+
+
+ This delegate supports static fields, even those defined in structs, for legacy reasons.
+ For such static fields, is effectively ignored.
+ This is also the reason that this delegate lacks a generic class constraint (it was added to certain FieldRefAccess methods,
+ but such a constraint cannot be added to this delegate without breaking binary compatibility).
+ Consider using (and StaticFieldRefAccess methods that return it) instead for static fields.
+
+
- Creates an instance field reference
- The class the field is defined in
- The type of the field
+ Creates a field reference delegate for an instance field of a class
+ The class that defines the instance field, or derived class of this type
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
The name of the field
- A read and writable field reference delegate
+ A readable/assignable delegate
- Creates an instance field reference for a specific instance
- The class the field is defined in
- The type of the field
+ Creates an instance field reference for a specific instance of a class
+ The class that defines the instance field, or derived class of this type
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
The instance
The name of the field
- An readable/assignable object representing the field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ FieldRefAccess<T, F>(instance, fieldName) is functionally equivalent to FieldRefAccess<T, F>(fieldName)(instance).
+
+
- Creates an instance field reference delegate for a private type
- The type of the field
- The class/type
+ Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+
+ The type that defines the field, or derived class of this type; must not be a struct type unless the field is static
+
The name of the field
- A read and writable delegate
+
+ A readable/assignable delegate with T=object
+ (for static fields, the instance delegate parameter is ignored)
+
+
+
+ This method is meant for cases where the given type is only known at runtime and thus can't be used as a type parameter T
+ in e.g. .
+
+
+ This method supports static fields, even those defined in structs, for legacy reasons.
+ Consider using (and other overloads) instead for static fields.
+
+
- Creates an instance field reference delegate for a fieldinfo
- The class the field is defined in or "object" if type cannot be accessed at compile time
- The type of the field
- The field of the field
- A read and writable delegate
+ Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
+
+ An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ),
+ implemented interface, or derived class of this type ("instanceOfT is FieldDeclaringType" must be possible)
+
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The field
+ A readable/assignable delegate
+
+
+ This method is meant for cases where the field has already been obtained, avoiding the field searching cost in
+ e.g. .
+
+
+ This method supports static fields, even those defined in structs, for legacy reasons.
+ For such static fields, is effectively ignored.
+ Consider using (and other overloads) instead for static fields.
+
+
+
+
+
+ Creates a field reference for an instance field of a class
+
+ The type that defines the field; or a parent class (including ), implemented interface, or derived class of this type
+ ("instanceOfT is FieldDeclaringType" must be possible)
+
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The instance
+ The field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ FieldRefAccess<T, F>(instance, fieldInfo) is functionally equivalent to FieldRefAccess<T, F>(fieldInfo)(instance).
+
+
+
+
+
+ A readable/assignable reference delegate to an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ A reference to the runtime instance to access the field
+ A readable/assignable reference to the field
+
+
+
+ Creates a field reference delegate for an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The name of the field
+ A readable/assignable delegate
+
+
+
+ Creates an instance field reference for a specific instance of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The instance
+ The name of the field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ StructFieldRefAccess<T, F>(ref instance, fieldName) is functionally equivalent to StructFieldRefAccess<T, F>(fieldName)(ref instance).
+
+
+
+
+
+ Creates a field reference delegate for an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The field
+ A readable/assignable delegate
+
+
+ This method is meant for cases where the field has already been obtained, avoiding the field searching cost in
+ e.g. .
+
+
+
+
+
+ Creates a field reference for an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The instance
+ The field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ StructFieldRefAccess<T, F>(ref instance, fieldInfo) is functionally equivalent to StructFieldRefAccess<T, F>(fieldInfo)(ref instance).
+
+
+
+
+
+ A readable/assignable reference delegate to a static field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ A readable/assignable reference to the field
Creates a static field reference
- The class the field is defined in or "object" if type cannot be accessed at compile time
- The type of the field
+ The type (can be class or struct) the field is defined in
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
The name of the field
- An readable/assignable object representing the static field
+ A readable/assignable reference to the field
Creates a static field reference
- The type of the field
- The class/type
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
+ The type (can be class or struct) the field is defined in
The name of the field
- An readable/assignable object representing the static field
+ A readable/assignable reference to the field
Creates a static field reference
- The class the field is defined in or "object" if type cannot be accessed at compile time
- The type of the field
+ An arbitrary type (by convention, the type the field is defined in)
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
The field
- An readable/assignable object representing the static field
-
-
-
- A read/writable reference delegate to a static field
- The type of the field
- An readable/assignable object representing the static field
+ A readable/assignable reference to the field
+
+ The type parameter is only used in exception messaging and to distinguish between this method overload
+ and the overload (which returns a rather than a reference).
+
Creates a static field reference delegate
- The type of the field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from the field's type
+
The field
- A read and writable delegate
+ A readable/assignable delegate
- Creates a delegate to a given method
- The delegate Type
- The method to create a delegate from.
-
- Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
- where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
- instance delegate where the delegate invocation always applies to the given .
-
-
- Only applies for instance methods. If true (default) and is virtual, invocation of the delegate
- calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called);
- else, invocation of the delegate calls the exact specified (this is useful for calling base class methods)
- Note: if false and is an interface method, an ArgumentException is thrown.
-
- A delegate of given to given
-
-
- Delegate invocation is more performant and more convenient to use than
- at a one-time setup cost.
-
-
- Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods,
- and both class and struct methods.
-
-
+ Creates a delegate to a given method
+ The delegate Type
+ The method to create a delegate from.
+
+ Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
+ where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
+ instance delegate where the delegate invocation always applies to the given .
+
+
+ Only applies for instance methods. If true (default) and is virtual, invocation of the delegate
+ calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called);
+ else, invocation of the delegate calls the exact specified (this is useful for calling base class methods)
+ Note: if false and is an interface method, an ArgumentException is thrown.
+
+ A delegate of given to given
+
+
+ Delegate invocation is more performant and more convenient to use than
+ at a one-time setup cost.
+
+
+ Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods,
+ and both class and struct methods.
+
+
- Creates a delegate for a given delegate definition, attributed with []
- The delegate Type, attributed with []
-
- Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
- where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
- instance delegate where the delegate invocation always applies to the given .
-
- A delegate of given to the method specified via []
- attributes on
-
- This calls with the method and virtualCall arguments
- determined from the [] attributes on ,
- and the given (for closed instance delegates).
-
+ Creates a delegate for a given delegate definition, attributed with []
+ The delegate Type, attributed with []
+
+ Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
+ where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
+ instance delegate where the delegate invocation always applies to the given .
+
+ A delegate of given to the method specified via []
+ attributes on
+
+ This calls with the method and virtualCall arguments
+ determined from the [] attributes on ,
+ and the given (for closed instance delegates).
+
@@ -2175,6 +2339,11 @@
The new instance
+
+
+ A cache for the or similar Add methods for different types.
+
+
Makes a deep copy of any object
The type of the instance that should be created
@@ -2219,15 +2388,15 @@
- Tests if a type is an integer type
- The type
- True if the type represents some integer
+ Tests if a type is an integer type
+ The type
+ True if the type represents some integer
- Tests if a type is a floating point type
- The type
- True if the type represents some floating point
+ Tests if a type is a floating point type
+ The type
+ True if the type represents some floating point
@@ -2578,19 +2747,19 @@
Returns true if the member has an IL body or false if not
- A file log for debugging
+ A file log for debugging
- Full pathname of the log file, defaults to a file called harmony.log.txt on your Desktop
+ Full pathname of the log file, defaults to a file called harmony.log.txt on your Desktop
- The indent character. The default is tab
+ The indent character. The default is tab
- The current indent level
+ The current indent level
@@ -2622,7 +2791,7 @@
- Flushes the log buffer to disk (use in combination with LogBuffered)
+ Flushes the log buffer to disk (use in combination with LogBuffered)
@@ -2631,7 +2800,7 @@
- Resets and deletes the log
+ Resets and deletes the log
diff --git a/1.2/Assemblies/BadHygiene.dll b/1.2/Assemblies/BadHygiene.dll
index bb6a44e..dc4eec3 100644
Binary files a/1.2/Assemblies/BadHygiene.dll and b/1.2/Assemblies/BadHygiene.dll differ
diff --git a/About/Manifest.xml b/About/Manifest.xml
index 5dabba3..a4e6a77 100644
--- a/About/Manifest.xml
+++ b/About/Manifest.xml
@@ -2,7 +2,7 @@
Dubs-Bad-Hygiene
- 2.8.1634
+ 2.8.1635
https://raw.githubusercontent.com/Dubwise56/Dubs-Bad-Hygiene/master/About/Manifest.xml
https://github.com/Dubwise56/Dubs-Bad-Hygiene/releases/latest