1
我想知道给定委托变量是否可能,以确定它是否实际指向对象方法,并且检索这个对象和方法的名字。检查委托是否是对象的方法,并检索此对象引用和方法名称
e.g:
public delegate void test();
public static test testDel = null;
public void TestMethod()
{
;
}
public void TestDelegate()
{
//here it is not a method of an object
testDel +=() => { };
// here it is "TestMethod"
testDel += this.TestMethod;
// i want something like that:
SomeDelegateInfoClass[] infos = testDel.GetAssignedObjectsAndMethodNames();
}
正是我所需要的,非常感谢你^^。 –