-
-
Save rolfbjarne/1ca6318058ac8507742e7b8f2df5296f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal RuntimeMethodInfo[] GetMethodsByName (string name, BindingFlags bindingAttr, MemberListType listType, RuntimeType reflectedType) | |
{ | |
global::Xamarin.WriteLine ("RuntimeType.GetMethodsByName (): 1"); | |
// global::Xamarin.WriteLine ($"RuntimeType.GetMethodsByName ({name}, {bindingAttr}, {listType}, {reflectedType}): 1"); | |
var refh = new RuntimeTypeHandle (reflectedType); | |
global::Xamarin.WriteLine ("RuntimeType.GetMethodsByName (): 2"); | |
using (var namePtr = new Mono.SafeStringMarshal (name)) | |
using (var h = new Mono.SafeGPtrArrayHandle (GetMethodsByName_native (namePtr.Value, bindingAttr, listType))) { | |
global::Xamarin.WriteLine ("RuntimeType.GetMethodsByName (): 4"); | |
var n = h.Length; | |
global::Xamarin.WriteLine ("RuntimeType.GetMethodsByName (): 5"); | |
var a = new RuntimeMethodInfo [n]; | |
global::Xamarin.WriteLine ("RuntimeType.GetMethodsByName (): 6"); | |
for (int i = 0; i < n; i++) { | |
global::System.Console.WriteLine ("RuntimeType.GetMethodsByName (): 7"); | |
var mh = new RuntimeMethodHandle (h[i]); | |
global::Xamarin.WriteLine ("RuntimeType.GetMethodsByName (): 8"); | |
a[i] = (RuntimeMethodInfo) MethodBase.GetMethodFromHandleNoGenericCheck (mh, refh); | |
global::System.Console.WriteLine ("RuntimeType.GetMethodsByName (): 9"); | |
} | |
global::Xamarin.WriteLine ("RuntimeType.GetMethodsByName (): 10"); | |
return a; | |
} | |
} | |
internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle, RuntimeTypeHandle reflectedType) | |
{ | |
global::Xamarin.WriteLine ($"MethodBase.GetMethodFromHandleNoGenericCheck (,) 1"); | |
global::Xamarin.WriteLine ($"MethodBase.GetMethodFromHandleNoGenericCheck ({handle}, {reflectedType})"); | |
var rv = GetMethodFromHandleInternalType_native (handle.Value, reflectedType.Value, false); | |
global::Xamarin.WriteLine ($"MethodBase.GetMethodFromHandleNoGenericCheck (,) 1 done"); | |
global::Xamarin.Sleep (10000); | |
return rv; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment