因此,您希望某人能够ExampleClass使用Engine.ExampleClassand访问Core.ExampleClass?我不确定你为什么会(我相信你有你的理由),但有两种方法可以揭露这样的事情:
namespace Foo
{
abstract class ExampleClass
{
//Only implement the class here
}
}
namespace Engine
{
class ExampleClass : Foo.ExampleClass
{
//Don't implement anything here (other than constructors to call base constructors)
}
}
namespace Core
{
class ExampleClass : Foo.ExampleClass
{
//Don't implement anything here (other than constructors to call base constructors)
}
}
或者您可以使用命名空间别名,但使用该类的每个 cs 文件都需要定义别名。
using Engine = Core;