一个C#中使用 event 和 delegate的小例子。
2009-02-25 17:42
531 查看
In event communication, the event sender class does not know which object or method will receive (handle) the events it raises. What is needed is an intermediary (or pointer-like mechanism) between the source and the receiver. The .NET Framework defines a special type (Delegate) that provides the functionality of a function pointer.
-------the relationship between Delegate & Event <MSDN>
Code
master: Where is my slave?
slave: I am here, my lord!
-------the relationship between Delegate & Event <MSDN>
Code
master: Where is my slave?
slave: I am here, my lord!
相关文章推荐
- c#学习笔记之九 事件(event)的使用,一个简单的例子揭示其设计理念
- c# 学习笔记之九 事件(event)的使用,一个简单例子揭示机理
- c#打包文件解压缩 C#中使用委托、接口、匿名方法、泛型委托实现加减乘除算法 一个简单例子理解C#的协变和逆变 对于过长字符串的大小比对
- 一个epoll/aio/eventfd结合使用的简单例子_sunfly_新浪博客
- 关于C#的delegate(委托)和event(事件)的使用
- CodeProject - 在C#使用SHGetFileInfo获取(管理)文件或者文件夹图标(C#封装Win32函数的一个例子)
- [置顶] [C#] delegate/event 的详细使用方法介绍与例程
- 使用C#的HttpWebRequest模拟登陆访问人人网(很好的一个例子,理解http的基本工作方式)
- C# event 的一个例子
- msdn 上的关于delegate和event的一个例子,理解后加点评论
- 一个epoll/aio/eventfd结合使用的简单例子
- c#项目中遇到的add event 的一个小例子
- Qt使用一个事件队列对所有发出的事件进行维护(QObject的event()函数相当于dispatch函数),用EventLabel 继承QLabel作为例子(简单明了) good
- 一个epoll/aio/eventfd结合使用的简单例子_sunfly_新浪博客
- 使用C#的HttpWebRequest模拟登陆访问人人网(很好的一个例子,理解http的基本工作方式)
- C#的事件(Event)和代理/委托(Delegate)例子
- 一个在c#中使用 二维数组的例子
- 使用C#的HttpWebRequest模拟登陆访问人人网(很好的一个例子,理解http的基本工作方式)
- C# delegate event 例子
- C#中Event和Delegate的混合使用