namespace enumInXamldemo
{
private class AClass
{
}
}
with the simple class definiiton, is there any problem with it?
yes, you cannot compile it, the C# compiler has made a step forward in making the some misleading access modifier invalid in some applications.
so it does not make sense to make a private class inside a namespace root because 1. by default the class definition is private, and 2. namespace does not have access control, you cannot say this class is pirvate inside this namespace, it only provide a name management ability ,but it does not control how the accessiblity is, because the accessiblity is specificed on the assembly level..
C#私有类访问修饰符
本文讨论了C#中私有类定义的问题,并解释为何不能在命名空间根目录下定义私有类。文章指出,C#编译器限制了这种用法,因为类默认就是私有的,同时命名空间本身并不提供访问控制。
1359

被折叠的 条评论
为什么被折叠?



