用于事件.NET的代表? [英] Are .NET delegates used for events?

查看:89
本文介绍了用于事件.NET的代表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点困惑,我知道代表是像函数指针,它们被用来传递函数作为参数传入的方法。

I'm little confused, I know that delegates are like function pointers, and they are used to pass a function as a parameter into a method.

这是如何配合到事件模型?

How does that fit into the event model?

电话:

myButton.OnClick += new .....();

时在内部正好传递方法/函数为在事件发生时,所有的订阅者通知有关该事件的参数

Is that internally just passing the method/function as a parameter when the event occurs and all the subscribers are notified about the event?

推荐答案

有一个在此

好奇心是福

这篇关于用于事件.NET的代表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆