.NET代理是否用于事件? [英] Are .NET delegates used for events?
本文介绍了.NET代理是否用于事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
适合事件模型?
调用:
myButton。 OnClick + = new .....();
内部只是在事件发生时传递方法/函数作为参数,所有订阅者都是通知有关事件?
解决方案
看看这个
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?
Calling:
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?
解决方案
Have a look at this
这篇关于.NET代理是否用于事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文