3 回答

TA貢獻(xiàn)1752條經(jīng)驗(yàn) 獲得超4個(gè)贊
namespace MyCorp.TheProduct.SomeModule.Utilities{ ...}
namespace MyCorp{ namespace TheProduct { namespace SomeModule { namespace Utilities { ... } } }}
using
using
(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
(包括繼承的嵌套類型) 當(dāng)前命名空間中的類型 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)內(nèi)部使用:
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
(包括繼承的嵌套類型) 當(dāng)前命名空間中的類型 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
結(jié)束語
[assembly: ComVisible(false)]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
.
- 3 回答
- 0 關(guān)注
- 416 瀏覽
添加回答
舉報(bào)