可能重复:
Should Usings be inside or outside the namespace“使用”的声明地点命名空间声明中
我支持一些代码,不寻常的,包含了命名空间声明中的所有其使用的语句。这让我有点不舒服,但我不知道这是否应该是值得关注的事情。除了与惯例相违背之外,我想不出一个直接的问题。
有什么不妥:
namespace myProject.controls
{
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
,而不是更广泛使用:
using语句 的using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace myProject.controls
{
本文可能有帮助:http://stackoverflow.com/questions/125319/should-usings-be-inside-or-outside-the-namespace – keyboardP 2011-05-13 02:49:36
作为一个完全重复的问题来关闭这个问题(因为我不能删除它)。 – 2011-05-13 03:19:44
可能重复? http://stackoverflow.com/questions/125319/should-usings-be-inside-or-outside-the-namespace – 2011-05-13 02:49:40