///和#region之間的區別是什麼##區域 c#中的註釋語句?哪一個最好?c /#和#region之間的區別#
2
A
回答
29
#region
根本不是評論聲明。它用於標記代碼段。 ///
用於documentation comments。
3
///用於XML註釋,而區域不用於評論,但用於將代碼段組合在一起。
2
///
- >可用於一些評論
#region ...#endregion
- >可以被用於標記的代碼組特定的區域,易於reffer
#region MainMethod
/// <summary>
/// Comments
/// </summary>
static void Main()
{
//Your code
}
#endregion
1
19
/// <summary>
/// Three forward slashes denote a documentation comment, which can be used in
/// conjunction with documentation tooling to generate API documentation for
/// your code.
/// </summary>
// two forward slashes denote a code comment, which you can use to provide
// commentary within your code
/*
This style of comment is called a block comment, which can be used to easily
comment out large blocks of text within your code
*/
#region Some Region Name
// the above region allows the developer to collapse/uncollapse everything
// within it, as long as their IDE supports regions
public void SomeMethod()
{
}
#endregion
1
///用來在你的代碼中插入XML註釋。 Xml註釋允許您從項目中構建一個輸出Xml文件: 稍後,Visual Studio將使用此文件向您顯示帶有插入註釋的智能感知工具提示。此外,您可以使用eit來構建自己的文檔。 從你的源代碼看這裏有關how to build documentation的文章Xml評論
#region用來組織你的代碼。
3
#region
,使你的代碼可讀性/維護只有IDE內有用它理解它(VS),讓您可以摺疊或展開的代碼,每一個地區你#區/#endregion定義/多組織
///
文件代碼!
0
一個區域用於摺疊大面積的代碼,//用於在計算機不讀取它的情況下添加註釋。
#region your large code
loads of code in this area.
#endregion
//This is just a note that the computer won't read.
相關問題
- 1. C#「var」和C++「auto」之間的區別
- 2. C和C++之間的區別
- 3. Java和C#和.NET之間的區別
- 4. `%in%`和`==`之間的區別
- 5. C中的/ +和+之間的區別?
- 6. ==和case之間的區別?
- 7. fmod和%之間的區別
- 8. C#中char和int之間的區別#
- 9. C#中Convert.ToString()和.ToString()之間的區別?
- 10. [abc]和(a | b | c)之間的區別
- 11. Ruby和C之間的主要區別
- 12. VS DataBreakpoints:C和C++之間的區別
- 13. objective-c @「hello」和「hello」之間的區別?
- 14. 「 - >」和「。」之間的區別用C
- 15. C和JAVA程序之間的區別
- 16. C++ 11 lambda:transform和for_each之間的區別
- 17. cout和C++之間的區別
- 18. lstat fstat和stat之間的區別C
- 19. Panel和UserControl之間的區別c#
- 20. C++ Builder - Lib和Res之間的區別
- 21. objective-c和java之間的區別
- 22. C++中map []和map.at之間的區別?
- 23. ASP.Net,C#.Net和VB.Net之間的區別?
- 24. Objective-C(null)和nil之間的區別
- 25. 「sh -c cmd」和「cmd」之間的區別?
- 26. 和之間的區別。在Objective-C
- 27. Objective-C - alloc和allocFromZone之間的區別?
- 28. Objective C,n ++和++之間的區別n
- 29. ASP和C#之間的語義區別?
- 30. C++中+ =和= +之間的區別
+1 ...和四個斜槓////是註釋掉實際代碼行的標準,其中/ * * /不起作用(並停止ReSharper呻吟:) – 2010-09-20 13:02:32