We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delegate
Current code :
class Demo { static void Test() { new HarmonyMethod(typeof(Demo).GetMethod("Method1", BindingFlags.NonPublic | BindingFlags.Static)); new HarmonyMethod(typeof(Demo).GetMethod("Method2", BindingFlags.NonPublic | BindingFlags.Static, null, new[] { typeof(int), typeof(string), typeof(object) }, null)); } static void Method1(int a, string b, object c) { } static void Method2(int a, string b) { } static void Method2(int a, string b, object c) { } }
Add Delegate overload
public HarmonyMethod(Delegate del) : this(del.Method) { }
in order to support :
class Demo { static void Test() { new HarmonyMethod(Method1); // C# 10.0 support `Natural type` new HarmonyMethod((Action<int, string, object>)Method2); } static void Method1(int a, string b, object c) { } static void Method2(int a, string b) { } static void Method2(int a, string b, object c) { } }
The text was updated successfully, but these errors were encountered:
e37d9ec
Merge pull request #521 from Banane9/add-delegate-overload-505
933620d
Add Delegate overloads and implicit casts to HarmonyMethod; Fixes #505
pardeike
No branches or pull requests
Current code :
Add
Delegate
overloadin order to support :
The text was updated successfully, but these errors were encountered: