EventArgs的 [英] EventArgs

查看:65
本文介绍了EventArgs的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有两个不同的事件触发同一事件。如何获得调用它的

类型的事件(离开或更改或点击)?我之前已经完成了这个
但是我记不起来了。


***通过开发人员发送索引 http://www.developersdex.com ***



I have two different events firing the same event. How can I get the
type of event that called it (either leave or valuechanged or click)? I
have done this before but I cannot remember how.

*** Sent via Developersdex http://www.developersdex.com ***

推荐答案




发生相同事件的两个事件?


我认为你的意思是处理两个事件的方法相同。


我认为这是一个设计问题为什么你使用相同的方法如果你想要知道(并且可能处理不同的)什么事件引发它?


我要做的是重构它,我将使用常见的

功能创建一个方法,并为每个执行特定操作的事件创建一个方法

你要区分。

-

-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州交通局


" John Sutor" < jp ***** @ yahoo.com写信息

新闻:uV ************** @ TK2MSFTNGP05.phx.gbl ...


Two events firing the same events?

I think you mean the same method that handle two events.

I think this is a design problem why are you using the same method IF you
want to know (and possible handle differentely) what event raised it?

What I would do is refactor it, I will create one method with the common
functionality and one method for each event that do the especifics actions
that you want to differentiate.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"John Sutor" <jp*****@yahoo.comwrote in message
news:uV**************@TK2MSFTNGP05.phx.gbl...

>


我有两个不同的事件触发相同的事件。如何获得调用它的

类型的事件(离开或更改或点击)?我之前已经完成了这个
但是我记不起来了。


***通过开发人员发送索引 http://www.developersdex.com ***
>

I have two different events firing the same event. How can I get the
type of event that called it (either leave or valuechanged or click)? I
have done this before but I cannot remember how.

*** Sent via Developersdex http://www.developersdex.com ***



这篇关于EventArgs的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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