Windows Forms Designer-自动在类前面添加名称空间 [英] Windows Forms Designer - automatically adds namespace in front of class
本文介绍了Windows Forms Designer-自动在类前面添加名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Visual Studio Designer中遇到问题.
I have problem with Visual Studio Designer.
当我显示表单设计时,设计器会自动在类的前面添加名称空间,该名称空间用作数据源. 但是此类与表单位于相同的名称空间.
When I display design of a form, designer automatically adds namespace in front of class, which is used as datasource. But this class is in the same namespace as the form.
这很烦人.
示例:
namespace Editor
{
partial class AddSignalForm
{
...
this.signalsBS.DataSource = typeof(Signal);
}
}
信号在命名空间Editor
中.
但是在我打开设计器后,代码更改为:
But after I open designer, code is changed to:
namespace Editor
{
partial class AddSignalForm
{
...
this.signalsBS.DataSource = typeof(Editor.Signal);
}
}
问题是编译器找不到类Editor.Editor.Signal
.
Problem is that compiler can not find class Editor.Editor.Signal
.
推荐答案
您似乎还有一个名为Editor
的类或属性,该类或属性与名称空间冲突.
You seem to have another class or property named Editor
which conflicts with the namespace.
这篇关于Windows Forms Designer-自动在类前面添加名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文