有没有一种方法可以在Delegate.CreateDelegate()函数中找出给定的MethodInfo可以分配哪些可用委托,而不必首先遍历所有引用的程序集来查找所有委托定义。或者我被困在做以下事情上: System.Collections.Generic.ListType t = delegateTypes[i]; * here is where to attempt match the delegate
我有一个MethodInfo对象,它定义了我想要调用的方法。除了我需要MethodInfo所在的objectvoid CallMethod(MethodInfo m) Object o = Activator.CreateInstancem.ClassType);}
除了我不知道如何获取MethodInfo如何调用MethodInf
所以我做了:
Dim separateClass AsNew SeparateClass
Dim methodInfo() As MethodInfo = separateClass.GetType.GetMethods(BindingFlags.NonPublicAddHandler labelList.Last.Click, AddressOf [Delegate].CreateDelegat