可能重複:
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