this.BeginInvoke((MethodInvoker)(this.Refresh));

this.BeginInvoke(new MethodInvoker(this.Refresh));
的区别是什么?

解决方案 »

  1.   

    多创建(new)一次l,直接转就可以
      

  2.   

    可以类比这个(引自MSDN):publisher.RaiseCustomEvent += HandleCustomEvent;
    请注意,前面的语法是 C# 2.0 中的新语法。 此语法完全等效于必须使用 new 关键字显式创建封装委托的 C# 1.0 语法: 
    publisher.RaiseCustomEvent += new CustomEventHandler(HandleCustomEvent);
      

  3.   

    //将this.Refresh转化为委托对象MethodInvoker
    this.BeginInvoke((MethodInvoker)(this.Refresh));
    //用MethodInvoker委托包装方法this.Refresh
    this.BeginInvoke(new MethodInvoker(this.Refresh));
      

  4.   

    用不着写 this.BeginInvoke((MethodInvoker)(this.Refresh));
    写 this.BeginInvoke(this.Refresh);  足够了。