`
ladymaidu
  • 浏览: 679606 次
文章分类
社区版块
存档分类
最新评论

Delegate & Event

 
阅读更多

A delegate is a reference type, like the other reference types you've seen in this book, but instead of referring to an object, a delegate refers to a method. This is called encapsulating the method. When you create the delegate, you specify a method signature and return type; you can encapsulate any matching method with that delegate.

Events enable a class or object to notify other classes or objects when something of interest occurs. The class that sends (or raises) the event is called the publisher and the classes that receive (or handle) the event are called subscribers.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics