如果“使用”是内部空间还是外部? [英] Should 'using' be inside the namespace or outside?

查看:96
本文介绍了如果“使用”是内部空间还是外部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  

可能重复:
  <一href="http://stackoverflow.com/questions/125319/should-usings-be-inside-or-outside-the-namespace">Should Usings的内部或命名空间外

是否有任何技术原因preferring这种

 命名空间富
{
     使用系统;
     使用System.IO;
 

而不是默认的

 使用系统;
使用System.IO;

命名空间富
{
 

解决方案

埃里克利珀的解释了这一

在一般情况下,他们是相同的。
然而,使用命名空间中的语句可以看到的命名空间和别名包括命名空间之外。

Possible Duplicate:
Should Usings be inside or outside the namespace

Are there any technical reasons for preferring this

namespace Foo
{
     using System;
     using System.IO;

instead of the default

using System;
using System.IO;

namespace Foo
{

解决方案

Eric Lippert explains this.

In general, they're identical.
However, using statements in the namespace can see namespaces and aliases included outside the namespace.

这篇关于如果“使用”是内部空间还是外部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆