星期二, 7月 22, 2008

整理class的using指示詞

昨天在翻書..發現Visual Studio 2008有一個蠻不錯的工具可以讓你的原始碼更精簡..就是這個..

njk

這可以讓你沒用到的using..就直接去掉還有幫你排序..幫你整理好..把那露露長的沒意義的using去掉..之前這功能約要外掛才能做到..現在有這..外掛就免啦..Batting EyelashesBatting EyelashesBatting EyelashesBatting EyelashesBatting EyelashesBatting Eyelashes..

看一下執行前後的原始碼..

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class test1_time : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string aa = "abcdefghijklmnopqrstuvwxyz";
foreach (char a in aa)
{
Response.Write(a + "<br />");
}
}
}

執行後..

using System;

public partial class test1_time : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string aa = "abcdefghijklmnopqrstuvwxyz";
foreach (char a in aa)
{
Response.Write(a + "<br />");
}
}
}

一整個清爽..DevilDevilDevilDevilDevilDevilDevilDevilDevil..推阿..

ps:使用建議..最好用在整個class完成後..不然去掉在加回來..小麻煩..Big Hug..

1 則留言:

williams 提到...

B大,這個讚,
感謝分享 :)