【发布时间】:2011-08-24 14:34:51
【问题描述】:
我正在支持一些代码,这些代码通常将其所有 using 语句都包含在命名空间声明中。这让我有点不舒服,但我不知道这是否应该引起关注。除了违反惯例之外,我想不出一个直接的问题。
有什么问题吗:
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 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
{
【问题讨论】:
-
这篇文章可能会有所帮助:stackoverflow.com/questions/125319/…
-
将此问题作为完全相同的副本关闭(因为我无法删除它)。
标签: c# namespaces structure conventions