本人前幾天剛剛接觸ASP.NET MVC架構,發現該架構裡面得類、方法、以及屬性等在vs2008中的代碼提示是英文的,個人感覺使用起來非常不方便,不知大家感覺如何,經過我的一番研究,終於發現了漢化的方法,其實很簡單,在MVC的安裝目錄的“Assemblies”檔案夾中有兩個檔案分別為:1、System.Web.Mvc.dll(MVC的程式集)2、System.Web.Mvc.xml此檔案為xml檔案,用記事本就可以開啟,當然最好用va2008開啟,開啟後的問價內容如下:
<?xml version="1.0"?>
<doc>
<assembly>
<name>System.Web.Mvc</name>
</assembly>
<members>
<member name="T:System.Web.Mvc.TempDataDictionary">
<summary>
<!--Represents a set of data that persists only from one request to the next-->.
代表一個數組
</summary>
</member>
<member name="M:System.Web.Mvc.TempDataDictionary.#ctor">
<summary>
初始化一個新的樣本 <see cref="T:System.Web.Mvc.TempDataDictionary"/> class.
</summary>
</member>
<member name="M:System.Web.Mvc.TempDataDictionary.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
<summary>
初始化一個新的樣本 <see cref="T:System.Web.Mvc.TempDataDictionary"/> class.
</summary>
<param name="info">The info.</param>
<param name="context">The context.</param>
</member>
<member name="M:System.Web.Mvc.TempDataDictionary.Load(System.Web.Mvc.ControllerContext,System.Web.Mvc.ITempDataProvider)">
<summary>
載入一個指定的 controller context.
</summary>
<param name="controllerContext">The controller context.</param>
<param name="tempDataProvider">The temp data provider.</param>
</member>
<member name="M:System.Web.Mvc.TempDataDictionary.Save(System.Web.Mvc.ControllerContext,System.Web.Mvc.ITempDataProvider)">
<summary>
儲存在指範圍的 controller context.
</summary>
<param name="controllerContext">The controller context.</param>
<param name="tempDataProvider">The temp data provider.</param>
</member>
<member name="M:System.Web.Mvc.TempDataDictionary.Add(System.String,System.Object)">
<summary>
Adds an element with the provided key and value to the <see cref="T:System.Collections.Generic.IDictionary`2"/>.
</summary>
<param name="key">The object to use as the key of the element to add.</param>
<param name="value">The object to use as the value of the element to add.</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="key"/> is null.
</exception>
<exception cref="T:System.ArgumentException">
An element with the same key already exists in the <see cref="T:System.Collections.Generic.IDictionary`2"/>.
</exception>
<exception cref="T:System.NotSupportedException">
The <see cref="T:System.Collections.Generic.IDictionary`2"/> is read-only.
</exception>
</member>
<member name="M:System.Web.Mvc.TempDataDictionary.Clear">
以其中一個節點為例講解:
<members>
<member name="T:System.Web.Mvc.TempDataDictionary">//類名稱
<summary>
<!--Represents a set of data that persists only from one request to the next-->//此處就是該類的詳細解釋(已被我注釋掉)
代表一個數組//此處是我用金山詞霸翻譯過來的詳細解釋
</summary>
</member>
由於本人E文不是一般的爛,所以希望E文高手能夠將這個檔案翻譯一下,造福廣大程式員,哈哈!
最後說一下如何使用漢化後的System.Web.Mvc.xml檔案,很簡單將原來的覆蓋即可(強烈建議:覆蓋前先備份System.Web.Mvc.xml)。
由於本人接觸MVC不久,不知我說的方法是否可行,本文也只是向拋磚引玉,希望高手們多多指教!