多播委托必须仅包含返回void的方法。为什么? [英] Multicast delegates must contain only methods that return void. why?

查看:45
本文介绍了多播委托必须仅包含返回void的方法。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

组播代表必须只包含返回void的方法。



为什么会这样?

Multicast delegates must contain only methods that return void.

why is it so?

推荐答案

代表如何知道您的多个注册所返回的对象应该返回处理?



它只能返回一个执行该事件只能有一个响应。



因此多播必须无效,以确保问题被否定。
How would the event for the delegate know which of the objects returned by your multiple registrations should be returned to be processed?

It can only return one as the execution of the event can only have one response.

Therefore multicast must be void ensuring the problem is negated.


这篇关于多播委托必须仅包含返回void的方法。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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