2008-08-29 86 views

回答

25

您可以使用XML樣式註釋並使用工具將這些註釋拖出到API文檔中。

這裏是註釋風格的例子:

/// <summary> 
/// Authenticates a user based on a username and password. 
/// </summary> 
/// <param name="username">The username.</param> 
/// <param name="password">The password.</param> 
/// <returns> 
/// True, if authentication is successful, otherwise False. 
/// </returns> 
/// <remarks> 
/// For use with local systems 
/// </remarks> 
public override bool Authenticate(string username, string password) 

的一些項目,以促進這一是:

GhostDoc,這給一個快捷鍵來自動生成一個類或方法的意見。 Sandcastle,它從XML註釋中生成MSDN樣式文檔。

+1

請參閱以下鏈接http://stackoverflow.com/questions/319632/docproject-vs-sandcastle-help-file-builder -gui瞭解更多關於Sandcastle的信息。 – 2009-01-12 21:09:12

1

微軟使用「XML Documentation Comments」這將給出IDE智能感知說明,並且還允許您在開啓XML文件輸出生成時使用Sandcastle等工具自動生成MSDN樣式的文檔。

要打開文檔的XML文件生成,請右鍵單擊Visual Studio中的項目,單擊「屬性」,然後轉到「生成」選項卡。接近底部,您可以爲您的XML註釋輸出文件指定一個位置。

0

我總是被告知使用2個或多個星號打開的塊註釋來劃定文檔註釋。

/** 
Documentation goes here. 
(flowerboxes optional) 
*/