Kri*_*ter 4 c# namespaces
是否可以在整个程序集中使用在一个文件中定义的别名?
例如.在Foo.cs我有
using IO = System.IO; namespace Foo {}
如何在FooBar.cs中使用别名"IO"
namespace Foo.Bar {}
Har*_*san 9
根据MSDN
The scope of a using directive is limited to the file in which it appears.
所以答案是否定的.您不能在一个文件中定义别名并在整个程序集中使用它
归档时间:
13 年,11 月 前
查看次数:
1578 次
最近记录: