委托是类型安全的指针函数,相当于C++的TYPEOF自定义类型,委托了事件后才能添加事件

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/3168/3168824.xml?temp=.5505945
      

  2.   

    http://community.csdn.net/Expert/topic/3168/3168824.xml?temp=.6804621
      

  3.   

    委托是要慢慢理解的,和C++里的回调函数很像。
    这个讲解是很好的:http://community.csdn.net/Expert/topic/3168/3168824.xml?temp=.5505945
      

  4.   

    可以把委托理解成type-safe 的函数指针,把事件理解成封装过的回调(callback).这里有"A Programmer's Introduction to C#"里的几段原文:C# supports delegates and events to encapsulate function pointers and callbacks.
    ........
    C# adds delegates, which can be thought of as typesafe function pointers. A class can create a
    delegate on a function in the class, and then that delegate can be passed off to a function that accepts
    the delegate. That function can then call the delegate.
    C# builds upon delegates with events, which are used by the .NET Frameworks. Events implement the
    publish-and-subscribe idiom; if an object (such as a control) supports a click event, any number of other
    classes can register a delegate to be called when that event is fired.希望能对你有点帮助