日期:2014-05-20  浏览次数:20707 次

begininvoke

第一张图,delegate类中明明没有begininvoke方法,可第二张图算什么?
delegate

------解决方案--------------------
本来就没有

BeginInvoke属于Control类(或者别的类)。
------解决方案--------------------

[CLS] CalculateMethod
   .class nested private auto ansi sealed 
    extends [mscorlib]System.MulticastDelegate 
   [MET] .ctor : void(object,native int)
   [MET] BeginInvoke : class [mscorlib]System.IAsyncResult(float64,class [mscorlib]System.AsyncCallback,object)
   [MET] EndInvoke : float64(class [mscorlib]System.IAsyncResult)
   [MET] Invoke : float64(float64)

可以看到委托被编译成了 CalculateMethod类 编译器为类增加了4个函数 
构造函数 BeginInvoke,EndInvoke ,Invoke 
所以“BeginInvoke”不是delegate的 是编译器给你加的.