VB.NET 在发布版本中生成属性
我有一个表单,我在 VB.NET 中拖放一个控件。
我有一句话说,
private WithEvents radioButton RadioButton
另外,我有一个处理程序,例如,
private void click(.....) Handles radioButton.Click
{
...
}
现在,当我在发布模式下构建这是 .NET 3.5 时,并在反射器工具中查看生成的代码,代码类似于,
Private Overridable Property radioButton As RadioButton
.
.
.
<AccessedThroughProperty("radioButton")> _
Private _radioButton As RadioButton
有人可以告诉我发生了什么吗?在这里? 如何避免生成新的属性和字段?
-达特
I have a form and i drag and drop a control in VB.NET.
I have a line say,
private WithEvents radioButton RadioButton
Also, I have a handler like,
private void click(.....) Handles radioButton.Click
{
...
}
Now, When I build this is .NET 3.5 in release mode, and see the generated code in reflector tool, the code is something like,
Private Overridable Property radioButton As RadioButton
.
.
.
<AccessedThroughProperty("radioButton")> _
Private _radioButton As RadioButton
Can someone tell me what is going on here?
And how do I avoid the generation of new properties and fields?
-datte
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WithEvents/Handles 构造是 VB.NET .NET Framework 类之上的语法。
在编译过程中,所有特定于语言的关键字都必须转换为等效的 .NET Framework API 调用,因为这是运行时可用的。
相关资源:
The WithEvents/Handles construct is VB.NET syntax on top of the .NET Framework classes.
During the compilation process all language-specific keywords must be translated into the equivalent .NET Framework API calls, since that is what's available at runtime.
Related resources: