From f4192663d78c7a45418f07f0bf4acb67b11291fe Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 5 May 2020 20:53:02 -0400 Subject: add Harmony 2.0 rewriters (#711) --- .../ModLoading/Finders/TypeAssemblyFinder.cs | 25 ++++++ .../Framework/ModLoading/Finders/TypeFinder.cs | 25 ++++++ .../ModLoading/Framework/BaseTypeFinder.cs | 34 +++----- .../Framework/BaseTypeReferenceRewriter.cs | 97 ++++++++-------------- src/SMAPI/Framework/ModLoading/RewriteHelper.cs | 2 +- .../Rewriters/Harmony1AssemblyRewriter.cs | 77 +++++++++++++++++ .../ModLoading/Rewriters/MethodParentRewriter.cs | 18 ++-- .../ModLoading/Rewriters/TypeReferenceRewriter.cs | 68 +++++++++++++++ .../RewriteFacades/HarmonyInstanceMethods.cs | 33 ++++++++ 9 files changed, 291 insertions(+), 88 deletions(-) create mode 100644 src/SMAPI/Framework/ModLoading/Finders/TypeAssemblyFinder.cs create mode 100644 src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs create mode 100644 src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs create mode 100644 src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs create mode 100644 src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/ModLoading/Finders/TypeAssemblyFinder.cs b/src/SMAPI/Framework/ModLoading/Finders/TypeAssemblyFinder.cs new file mode 100644 index 00000000..5301186b --- /dev/null +++ b/src/SMAPI/Framework/ModLoading/Finders/TypeAssemblyFinder.cs @@ -0,0 +1,25 @@ +using System; +using Mono.Cecil; +using StardewModdingAPI.Framework.ModLoading.Framework; + +namespace StardewModdingAPI.Framework.ModLoading.Finders +{ + /// Finds incompatible CIL instructions that reference types in a given assembly. + internal class TypeAssemblyFinder : BaseTypeFinder + { + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The full assembly name to which to find references. + /// The result to return for matching instructions. + /// A lambda which overrides a matched type. + public TypeAssemblyFinder(string assemblyName, InstructionHandleResult result, Func shouldIgnore = null) + : base( + isMatch: type => type.Scope.Name == assemblyName && (shouldIgnore == null || !shouldIgnore(type)), + result: result, + nounPhrase: $"{assemblyName} assembly" + ) + { } + } +} diff --git a/src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs b/src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs new file mode 100644 index 00000000..3adc31c7 --- /dev/null +++ b/src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs @@ -0,0 +1,25 @@ +using System; +using Mono.Cecil; +using StardewModdingAPI.Framework.ModLoading.Framework; + +namespace StardewModdingAPI.Framework.ModLoading.Finders +{ + /// Finds incompatible CIL instructions that reference a given type. + internal class TypeFinder : BaseTypeFinder + { + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The full type name to match. + /// The result to return for matching instructions. + /// A lambda which overrides a matched type. + public TypeFinder(string fullTypeName, InstructionHandleResult result, Func shouldIgnore = null) + : base( + isMatch: type => type.FullName == fullTypeName && (shouldIgnore == null || !shouldIgnore(type)), + result: result, + nounPhrase: $"{fullTypeName} type" + ) + { } + } +} diff --git a/src/SMAPI/Framework/ModLoading/Framework/BaseTypeFinder.cs b/src/SMAPI/Framework/ModLoading/Framework/BaseTypeFinder.cs index 170bbb48..b1547334 100644 --- a/src/SMAPI/Framework/ModLoading/Framework/BaseTypeFinder.cs +++ b/src/SMAPI/Framework/ModLoading/Framework/BaseTypeFinder.cs @@ -5,21 +5,18 @@ using Mono.Cecil.Cil; namespace StardewModdingAPI.Framework.ModLoading.Framework { - /// Finds incompatible CIL instructions that reference a given type. - internal class TypeFinder : IInstructionHandler + /// Finds incompatible CIL type reference instructions. + internal abstract class BaseTypeFinder : IInstructionHandler { /********* ** Accessors *********/ - /// The full type name for which to find references. - private readonly string FullTypeName; + /// Matches the type references to handle. + private readonly Func IsMatchImpl; /// The result to return for matching instructions. private readonly InstructionHandleResult Result; - /// A lambda which overrides a matched type. - protected readonly Func ShouldIgnore; - /********* ** Accessors @@ -32,15 +29,14 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework ** Public methods *********/ /// Construct an instance. - /// The full type name to match. + /// Matches the type references to handle. /// The result to return for matching instructions. - /// A lambda which overrides a matched type. - public TypeFinder(string fullTypeName, InstructionHandleResult result, Func shouldIgnore = null) + /// A brief noun phrase indicating what the instruction finder matches. + public BaseTypeFinder(Func isMatch, InstructionHandleResult result, string nounPhrase) { - this.FullTypeName = fullTypeName; + this.IsMatchImpl = isMatch; this.Result = result; - this.NounPhrase = $"{fullTypeName} type"; - this.ShouldIgnore = shouldIgnore ?? (p => false); + this.NounPhrase = nounPhrase; } /// Perform the predefined logic for a method if applicable. @@ -68,13 +64,9 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework : InstructionHandleResult.None; } - - /********* - ** Protected methods - *********/ /// Get whether a CIL instruction matches. /// The method definition. - protected bool IsMatch(MethodDefinition method) + public bool IsMatch(MethodDefinition method) { if (this.IsMatch(method.ReturnType)) return true; @@ -90,7 +82,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// Get whether a CIL instruction matches. /// The IL instruction. - protected bool IsMatch(Instruction instruction) + public bool IsMatch(Instruction instruction) { // field reference FieldReference fieldRef = RewriteHelper.AsFieldReference(instruction); @@ -116,10 +108,10 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// Get whether a type reference matches the expected type. /// The type to check. - protected bool IsMatch(TypeReference type) + public bool IsMatch(TypeReference type) { // root type - if (type.FullName == this.FullTypeName && !this.ShouldIgnore(type)) + if (this.IsMatchImpl(type)) return true; // generic arguments diff --git a/src/SMAPI/Framework/ModLoading/Framework/BaseTypeReferenceRewriter.cs b/src/SMAPI/Framework/ModLoading/Framework/BaseTypeReferenceRewriter.cs index 8c2d11c8..55ce6b5a 100644 --- a/src/SMAPI/Framework/ModLoading/Framework/BaseTypeReferenceRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Framework/BaseTypeReferenceRewriter.cs @@ -5,30 +5,32 @@ using Mono.Cecil.Cil; namespace StardewModdingAPI.Framework.ModLoading.Framework { /// Rewrites all references to a type. - internal class TypeReferenceRewriter : TypeFinder + internal abstract class BaseTypeReferenceRewriter : IInstructionHandler { /********* ** Fields *********/ - /// The full type name to which to find references. - private readonly string FromTypeName; + /// The type finder which matches types to rewrite. + private readonly BaseTypeFinder Finder; - /// The new type to reference. - private readonly Type ToType; + + /********* + ** Accessors + *********/ + /// A brief noun phrase indicating what the handler matches. + public string NounPhrase { get; } /********* ** Public methods *********/ /// Construct an instance. - /// The full type name to which to find references. - /// The new type to reference. - /// A lambda which overrides a matched type. - public TypeReferenceRewriter(string fromTypeFullName, Type toType, Func shouldIgnore = null) - : base(fromTypeFullName, InstructionHandleResult.None, shouldIgnore) + /// The type finder which matches types to rewrite. + /// A brief noun phrase indicating what the instruction finder matches. + public BaseTypeReferenceRewriter(BaseTypeFinder finder, string nounPhrase) { - this.FromTypeName = fromTypeFullName; - this.ToType = toType; + this.Finder = finder; + this.NounPhrase = nounPhrase; } /// Perform the predefined logic for a method if applicable. @@ -36,46 +38,36 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// The method definition containing the instruction. /// Metadata for mapping assemblies to the current platform. /// Whether the mod was compiled on a different platform. - public override InstructionHandleResult Handle(ModuleDefinition module, MethodDefinition method, PlatformAssemblyMap assemblyMap, bool platformChanged) + public InstructionHandleResult Handle(ModuleDefinition module, MethodDefinition method, PlatformAssemblyMap assemblyMap, bool platformChanged) { bool rewritten = false; // return type - if (this.IsMatch(method.ReturnType)) + if (this.Finder.IsMatch(method.ReturnType)) { - this.RewriteIfNeeded(module, method.ReturnType, newType => method.ReturnType = newType); - rewritten = true; + rewritten |= this.RewriteIfNeeded(module, method.ReturnType, newType => method.ReturnType = newType); } // parameters foreach (ParameterDefinition parameter in method.Parameters) { - if (this.IsMatch(parameter.ParameterType)) - { - this.RewriteIfNeeded(module, parameter.ParameterType, newType => parameter.ParameterType = newType); - rewritten = true; - } + if (this.Finder.IsMatch(parameter.ParameterType)) + rewritten |= this.RewriteIfNeeded(module, parameter.ParameterType, newType => parameter.ParameterType = newType); } // generic parameters for (int i = 0; i < method.GenericParameters.Count; i++) { var parameter = method.GenericParameters[i]; - if (this.IsMatch(parameter)) - { - this.RewriteIfNeeded(module, parameter, newType => method.GenericParameters[i] = new GenericParameter(parameter.Name, newType)); - rewritten = true; - } + if (this.Finder.IsMatch(parameter)) + rewritten |= this.RewriteIfNeeded(module, parameter, newType => method.GenericParameters[i] = new GenericParameter(parameter.Name, newType)); } // local variables foreach (VariableDefinition variable in method.Body.Variables) { - if (this.IsMatch(variable.VariableType)) - { - this.RewriteIfNeeded(module, variable.VariableType, newType => variable.VariableType = newType); - rewritten = true; - } + if (this.Finder.IsMatch(variable.VariableType)) + rewritten |= this.RewriteIfNeeded(module, variable.VariableType, newType => variable.VariableType = newType); } return rewritten @@ -89,34 +81,37 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// The instruction to handle. /// Metadata for mapping assemblies to the current platform. /// Whether the mod was compiled on a different platform. - public override InstructionHandleResult Handle(ModuleDefinition module, ILProcessor cil, Instruction instruction, PlatformAssemblyMap assemblyMap, bool platformChanged) + public InstructionHandleResult Handle(ModuleDefinition module, ILProcessor cil, Instruction instruction, PlatformAssemblyMap assemblyMap, bool platformChanged) { - if (!this.IsMatch(instruction)) + if (!this.Finder.IsMatch(instruction)) return InstructionHandleResult.None; + bool rewritten = false; // field reference FieldReference fieldRef = RewriteHelper.AsFieldReference(instruction); if (fieldRef != null) { - this.RewriteIfNeeded(module, fieldRef.DeclaringType, newType => fieldRef.DeclaringType = newType); - this.RewriteIfNeeded(module, fieldRef.FieldType, newType => fieldRef.FieldType = newType); + rewritten |= this.RewriteIfNeeded(module, fieldRef.DeclaringType, newType => fieldRef.DeclaringType = newType); + rewritten |= this.RewriteIfNeeded(module, fieldRef.FieldType, newType => fieldRef.FieldType = newType); } // method reference MethodReference methodRef = RewriteHelper.AsMethodReference(instruction); if (methodRef != null) { - this.RewriteIfNeeded(module, methodRef.DeclaringType, newType => methodRef.DeclaringType = newType); - this.RewriteIfNeeded(module, methodRef.ReturnType, newType => methodRef.ReturnType = newType); + rewritten |= this.RewriteIfNeeded(module, methodRef.DeclaringType, newType => methodRef.DeclaringType = newType); + rewritten |= this.RewriteIfNeeded(module, methodRef.ReturnType, newType => methodRef.ReturnType = newType); foreach (var parameter in methodRef.Parameters) - this.RewriteIfNeeded(module, parameter.ParameterType, newType => parameter.ParameterType = newType); + rewritten |= this.RewriteIfNeeded(module, parameter.ParameterType, newType => parameter.ParameterType = newType); } // type reference if (instruction.Operand is TypeReference typeRef) - this.RewriteIfNeeded(module, typeRef, newType => cil.Replace(instruction, cil.Create(instruction.OpCode, newType))); + rewritten |= this.RewriteIfNeeded(module, typeRef, newType => cil.Replace(instruction, cil.Create(instruction.OpCode, newType))); - return InstructionHandleResult.Rewritten; + return rewritten + ? InstructionHandleResult.Rewritten + : InstructionHandleResult.None; } /********* @@ -126,26 +121,6 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// The assembly module containing the instruction. /// The type to replace if it matches. /// Assign the new type reference. - private void RewriteIfNeeded(ModuleDefinition module, TypeReference type, Action set) - { - // current type - if (type.FullName == this.FromTypeName) - { - if (!this.ShouldIgnore(type)) - set(module.ImportReference(this.ToType)); - return; - } - - // recurse into generic arguments - if (type is GenericInstanceType genericType) - { - for (int i = 0; i < genericType.GenericArguments.Count; i++) - this.RewriteIfNeeded(module, genericType.GenericArguments[i], typeRef => genericType.GenericArguments[i] = typeRef); - } - - // recurse into generic parameters (e.g. constraints) - for (int i = 0; i < type.GenericParameters.Count; i++) - this.RewriteIfNeeded(module, type.GenericParameters[i], typeRef => type.GenericParameters[i] = new GenericParameter(typeRef)); - } + protected abstract bool RewriteIfNeeded(ModuleDefinition module, TypeReference type, Action set); } } diff --git a/src/SMAPI/Framework/ModLoading/RewriteHelper.cs b/src/SMAPI/Framework/ModLoading/RewriteHelper.cs index f8f10dc4..d9a49cfa 100644 --- a/src/SMAPI/Framework/ModLoading/RewriteHelper.cs +++ b/src/SMAPI/Framework/ModLoading/RewriteHelper.cs @@ -103,7 +103,7 @@ namespace StardewModdingAPI.Framework.ModLoading public static bool HasMatchingSignature(Type type, MethodReference reference) { return type - .GetMethods(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public) + .GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public) .Any(method => RewriteHelper.HasMatchingSignature(method, reference)); } } diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs new file mode 100644 index 00000000..29e44bfe --- /dev/null +++ b/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs @@ -0,0 +1,77 @@ +using System; +using Mono.Cecil; +using StardewModdingAPI.Framework.ModLoading.Finders; +using StardewModdingAPI.Framework.ModLoading.Framework; + +namespace StardewModdingAPI.Framework.ModLoading.Rewriters +{ + /// Rewrites Harmony 1.x assembly references to work with Harmony 2.x. + internal class Harmony1AssemblyRewriter : BaseTypeReferenceRewriter + { + /********* + ** Fields + *********/ + /// The full assembly name to which to find references. + private const string FromAssemblyName = "0Harmony"; + + /// The main Harmony type. + private readonly Type HarmonyType = typeof(HarmonyLib.Harmony); + + + /********* + ** Public methods + *********/ + /// Construct an instance. + public Harmony1AssemblyRewriter() + : base(new TypeAssemblyFinder(Harmony1AssemblyRewriter.FromAssemblyName, InstructionHandleResult.None), "Harmony 1.x types") + { } + + + /********* + ** Private methods + *********/ + /// Change a type reference if needed. + /// The assembly module containing the instruction. + /// The type to replace if it matches. + /// Assign the new type reference. + protected override bool RewriteIfNeeded(ModuleDefinition module, TypeReference type, Action set) + { + bool rewritten = false; + + // current type + if (type.Scope.Name == Harmony1AssemblyRewriter.FromAssemblyName && type.Scope is AssemblyNameReference assemblyScope && assemblyScope.Version.Major == 1) + { + Type targetType = this.GetMappedType(type); + set(module.ImportReference(targetType)); + return true; + } + + // recurse into generic arguments + if (type is GenericInstanceType genericType) + { + for (int i = 0; i < genericType.GenericArguments.Count; i++) + rewritten |= this.RewriteIfNeeded(module, genericType.GenericArguments[i], typeRef => genericType.GenericArguments[i] = typeRef); + } + + // recurse into generic parameters (e.g. constraints) + for (int i = 0; i < type.GenericParameters.Count; i++) + rewritten |= this.RewriteIfNeeded(module, type.GenericParameters[i], typeRef => type.GenericParameters[i] = new GenericParameter(typeRef)); + + return rewritten; + } + + /// Get an equivalent Harmony 2.x type. + /// The Harmony 1.x method. + private Type GetMappedType(TypeReference type) + { + // main Harmony object + if (type.FullName == "Harmony.HarmonyInstance") + return this.HarmonyType; + + // other objects + string fullName = type.FullName.Replace("Harmony.", "HarmonyLib."); + string targetName = this.HarmonyType.AssemblyQualifiedName.Replace(this.HarmonyType.FullName, fullName); + return Type.GetType(targetName, throwOnError: true); + } + } +} diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs index 6b8c2de1..0984dc44 100644 --- a/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Mono.Cecil; using Mono.Cecil.Cil; @@ -10,8 +11,8 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters /********* ** Fields *********/ - /// The type whose methods to remap. - private readonly Type FromType; + /// The full name of the type whose methods to remap. + private readonly string FromType; /// The type with methods to map to. private readonly Type ToType; @@ -34,14 +35,21 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters /// The type whose methods to remap. /// The type with methods to map to. /// Whether to only rewrite references if loading the assembly on a different platform than it was compiled on. - public MethodParentRewriter(Type fromType, Type toType, bool onlyIfPlatformChanged = false) + public MethodParentRewriter(string fromType, Type toType, bool onlyIfPlatformChanged = false) { this.FromType = fromType; this.ToType = toType; - this.NounPhrase = $"{fromType.Name} methods"; + this.NounPhrase = $"{fromType.Split('.').Last()} methods"; this.OnlyIfPlatformChanged = onlyIfPlatformChanged; } + /// Construct an instance. + /// The type whose methods to remap. + /// The type with methods to map to. + /// Whether to only rewrite references if loading the assembly on a different platform than it was compiled on. + public MethodParentRewriter(Type fromType, Type toType, bool onlyIfPlatformChanged = false) + : this(fromType.FullName, toType, onlyIfPlatformChanged) { } + /// Perform the predefined logic for a method if applicable. /// The assembly module containing the instruction. /// The method definition containing the instruction. @@ -81,7 +89,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters return methodRef != null && (platformChanged || !this.OnlyIfPlatformChanged) - && methodRef.DeclaringType.FullName == this.FromType.FullName + && methodRef.DeclaringType.FullName == this.FromType && RewriteHelper.HasMatchingSignature(this.ToType, methodRef); } } diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs new file mode 100644 index 00000000..d95e5ac9 --- /dev/null +++ b/src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs @@ -0,0 +1,68 @@ +using System; +using Mono.Cecil; +using StardewModdingAPI.Framework.ModLoading.Finders; +using StardewModdingAPI.Framework.ModLoading.Framework; + +namespace StardewModdingAPI.Framework.ModLoading.Rewriters +{ + /// Rewrites all references to a type. + internal class TypeReferenceRewriter : BaseTypeReferenceRewriter + { + /********* + ** Fields + *********/ + /// The full type name to which to find references. + private readonly string FromTypeName; + + /// The new type to reference. + private readonly Type ToType; + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The full type name to which to find references. + /// The new type to reference. + /// A lambda which overrides a matched type. + public TypeReferenceRewriter(string fromTypeFullName, Type toType, Func shouldIgnore = null) + : base(new TypeFinder(fromTypeFullName, InstructionHandleResult.None, shouldIgnore), $"{fromTypeFullName} type") + { + this.FromTypeName = fromTypeFullName; + this.ToType = toType; + } + + + /********* + ** Protected methods + *********/ + /// Change a type reference if needed. + /// The assembly module containing the instruction. + /// The type to replace if it matches. + /// Assign the new type reference. + protected override bool RewriteIfNeeded(ModuleDefinition module, TypeReference type, Action set) + { + bool rewritten = false; + + // current type + if (type.FullName == this.FromTypeName) + { + set(module.ImportReference(this.ToType)); + return true; + } + + // recurse into generic arguments + if (type is GenericInstanceType genericType) + { + for (int i = 0; i < genericType.GenericArguments.Count; i++) + rewritten |= this.RewriteIfNeeded(module, genericType.GenericArguments[i], typeRef => genericType.GenericArguments[i] = typeRef); + } + + // recurse into generic parameters (e.g. constraints) + for (int i = 0; i < type.GenericParameters.Count; i++) + rewritten |= this.RewriteIfNeeded(module, type.GenericParameters[i], typeRef => type.GenericParameters[i] = new GenericParameter(typeRef)); + + return rewritten; + } + } +} diff --git a/src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs b/src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs new file mode 100644 index 00000000..0f906f51 --- /dev/null +++ b/src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs @@ -0,0 +1,33 @@ +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; +using HarmonyLib; + +namespace StardewModdingAPI.Framework.RewriteFacades +{ + /// Maps Harmony 1.x methods to Harmony 2.x to avoid breaking older mods. + /// This is public to support SMAPI rewriting and should not be referenced directly by mods. + public class HarmonyInstanceMethods : Harmony + { + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The unique patch identifier. + public HarmonyInstanceMethods(string id) + : base(id) { } + + /// Creates a new Harmony instance. + /// A unique identifier for the instance. + public static Harmony Create(string id) + { + return new Harmony(id); + } + + public DynamicMethod Patch(MethodBase original, HarmonyMethod prefix = null, HarmonyMethod postfix = null, HarmonyMethod transpiler = null) + { + MethodInfo method = base.Patch(original: original, prefix: prefix, postfix: postfix, transpiler: transpiler); + return new DynamicMethod(method.Name, method.Attributes, method.CallingConvention, method.ReturnType, method.GetParameters().Select(p => p.ParameterType).ToArray(), method.Module, true); + } + } +} -- cgit