是否是“System.EventArgs”?创建一个无限循环的对象“空”? [英] Does the "System.EventArgs" create an infinite loop of the object "Empty"?
本文介绍了是否是“System.EventArgs”?创建一个无限循环的对象“空”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在ContextMenu上有一个事件,其中System.EventArgs作为参数
事件过程如下所示:
I'm having an event on my ContextMenu which have the "System.EventArgs" as a parameter
The event procedure looks like this:
Private Sub CMRoot_ItemClicked(Sender As Object, e As System.EventArgs) Handles CMRoot.ItemClicked
似乎 e 对象填充了无限循环对象清空。
屏幕转储
这是我应该担心的事情吗?
It seems the "e" object is populated with an infinite loop of the object "Empty".
screen dump
Is this something I should be worried about?
推荐答案
简答,没有。
答案很长。
原因是 System.EventArgs.Empty [ ^ ]是一个静态字段,给出一个空EventArgs然后当你在调试器中进入那个静态字段时,它会给你一个新的Empty EventArgs,一个新的和一个新的等等。
Short answer, no.
Long answer.
The reason is that System.EventArgs.Empty[^] is a Static field, that gives an Empty EventArgs and when you then in debugger goes in that static field, it will give you a new Empty EventArgs, and a new one and an new etc.
这篇关于是否是“System.EventArgs”?创建一个无限循环的对象“空”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文