如何解决两个命名空间之间的冲突?
如果我有两个类的命名空间。我想使用一个命名空间中的类,并且我有 Resharpner 工具。即使我选择 Font 类的完整限定名称,它也会使用系统命名空间中的 Font。如何使用标签以及是否会
使用System.Windows.Forms删除调试功能;
使用 Cy.GlobalSettings.ChartSettings;
但有问题
当前命名空间是 Cy.GlobalSettings.ChartSettingsUC;
字体类别有冲突?
If I have namespace with two classes. I want to use class from one namespace and I have Resharpner tool. Even I select full qualifies name of my Font class it will use Font from System namespace. How to use label and will it removed debugging capability
using System.Windows.Forms;
using Cy.GlobalSettings.ChartSettings;
but have problem
current namespace is Cy.GlobalSettings.ChartSettingsUC;
Font class has a confilct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果两个引用的命名空间中的类名相同,则可以重命名类。如果两个命名空间都有一个名为 Font 的类,您可以为命名空间或类型创建别名:
此后,您可以在代码中同时使用 Font 和 CyFont,而不会发生冲突。
using 指令(C# 参考)
http://msdn.microsoft.com/en- us/library/sf0df423(v=vs.80).aspx
完全限定名称也应该有效。
You can rename classes if the class name is the same in both referenced namespace. If both namespace have a class called Font you can create an alias for a namespace or a type:
After this you can use both Font and CyFont in your code without conflicts.
using Directive (C# Reference)
http://msdn.microsoft.com/en-us/library/sf0df423(v=vs.80).aspx
Fully qualified name should work as well.