事件是否在.NET中返回任何内容 [英] Does event return anything in .NET

查看:63
本文介绍了事件是否在.NET中返回任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

事件返回什么吗?
如果是,则返回什么?

Does event return anything?
If yes,then what it returns?

推荐答案

^ ]

请不要那么懒,尝试自己阅读和查找它.如果您仍然感到困惑,请尽力告诉我们这是什么问题.
Let me Google it for you[^]

Please don''t be so lazy and try to read and find it by yourself. If you are still confused then do tell us with effort that what is the issue.


您好,

事件引发,但不返回
大多数情况下,事件处理程序也不会返回任何内容.因为该事件由许多订阅者订阅,所以该事件应该以随机顺序接收多个值.甚至事件也无法识别谁返回了值.通过委托将处理解耦.因此,该事件接收值是没有用的,因此不鼓励使用.因此,事件处理程序签名带有"void".

但是您可以从事件处理代码中设置全局变量.
Hi

The event raises, not returns
mostly the event handler''s also doesn''t return anything. Because the event subscribed by many subscriber then the event supposed to receive multiple values in random order. Even the event can''t identify who is return the value. The handling is decoupled through a delegate. So it is useless for the event to receive values and it is discouraged. So the event handler signature comes with the "void".

But you can set your global variables from the event handling code.


不返回.您可以引发一个事件.
Does not return. You can raise an event.


这篇关于事件是否在.NET中返回任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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