[英]What is the difference between a “build” and a “rebuild” in Visual Studio?
[英]What is the difference between // and /// in Visual Studio?
當我評論時,Stylecop告訴我使用///代替//。 這兩者的語義差異是什么?何時應該使用哪一個?
//表示您自己的個人注釋,其中///表示可以包含特殊數據的注釋,例如Visual Studio的解釋標記 - 如:
/// <summary>
/// This class does something.
/// </summary>
class Bob {
...
}
這將告訴Visual Studio Bob類的摘要,然后它將顯示在您的代碼完成框中。
通過進一步的Stylecop規則自己找到它:
在評論時使用//
在記錄XML文檔標題時使用///
三斜杠為您提供自動生成的模板,其中包含參數和其他功能
/// <summary>
/// Here is your comment
/// </summary>
/// <param name="sender">parameter generated automatically</param>
/// <param name="e">as above</param>
void BindableCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
這種方法意味着NDoc等工具可以拖拽您的源代碼,自動創建文檔文件。 雙斜線只是不削減它....
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.