3 回答
TA贡献1752条经验 获得超4个赞
namespace MyCorp.TheProduct.SomeModule.Utilities{
...}namespace MyCorp{
namespace TheProduct
{
namespace SomeModule
{
namespace Utilities
{
...
}
}
}}usingusing
(1)外部使用:
using System;using System.Collections.Generic;using System.Linq;//using MyCorp.TheProduct; <-- uncommenting this would change nothingusing
MyCorp.TheProduct.OtherModule;using MyCorp.TheProduct.OtherModule.Integration;using ThirdParty;namespace MyCorp.TheProduct.SomeModule
.Utilities{
class C {
Ambiguous a;
}}Ambiguous
嵌套类型 C(包括继承的嵌套类型) 当前命名空间中的类型 MyCorp.TheProduct.SomeModule.Utilities命名空间中的类型 MyCorp.TheProduct.SomeModule类型 MyCorp.TheProduct类型 MyCorp类中的类型。 零
命名空间(全局命名空间) 类型 System,System.Collections.Generic,System.Linq,MyCorp.TheProduct.OtherModule,MyCorp.TheProduct.OtherModule.Integration,和 ThirdParty
(2)内部使用:
namespace MyCorp.TheProduct.SomeModule.Utilities{
using System;
using System.Collections.Generic;
using System.Linq;
using MyCorp.TheProduct; // MyCorp can be left out; this using is NOT redundant
using MyCorp.TheProduct.OtherModule; // MyCorp.TheProduct can be left out
using MyCorp.TheProduct.OtherModule.Integration; // MyCorp.TheProduct can be left out
using ThirdParty;
class C {
Ambiguous a;
}}Ambiguous
嵌套类型 C(包括继承的嵌套类型) 当前命名空间中的类型 MyCorp.TheProduct.SomeModule.Utilities类型 System,System.Collections.Generic,System.Linq,MyCorp.TheProduct,MyCorp.TheProduct.OtherModule,MyCorp.TheProduct.OtherModule.Integration,和 ThirdParty命名空间中的类型 MyCorp.TheProduct.SomeModule类型 MyCorp类中的类型。 零
命名空间(全局命名空间)
MyCorp.TheProduct
结束语
[assembly: ComVisible(false)][assembly: System.Runtime.InteropServices.ComVisible(false)].
- 3 回答
- 0 关注
- 452 浏览
添加回答
举报
