命名空间和阶级冲突(?) [英] Namespace and class conflict(?)
本文介绍了命名空间和阶级冲突(?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是问题的一个坏的冠军,但我不是很确定一个更好的。
This is a bad title for the question, but I'm not quite sure of a better one.
我有一个名为具有类X的全局命名空间它。我也有一个名为Globals类。当我尝试访问Globals.X.StaticMember它试图访问类Globals.X并抱怨说,X不存在。我如何引用全局命名空间 - 即:: Globals.X.StaticMember(::没有编译)
I have a namespace called Globals with a class X in it. I also have a class called Globals. When I try to access Globals.X.StaticMember it tries to access the class Globals.X and complains that X doesn't exist. How do I reference the namespace Globals - ie ::Globals.X.StaticMember (:: doesn't compile).
推荐答案
尝试全球:: Globals.X.StaticMember
。
和全局是邪恶的!
这篇关于命名空间和阶级冲突(?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文