成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

詳解C#文檔XML標記

開發 后端
C#文檔XML標記的屬性和使用在我們開發過程中經常會用,那么這里就向你介紹C#文檔XML標記的屬性和特點以及應用實例,希望對你學習C#文檔XML標記有所幫助。

C#文檔XML標記是我們在C#文檔制作的時候必須要使用的,那么關于C#文檔XML標記的各種標記的屬性是如何的呢?我們使用中會有什么特點呢?那么讓我們來具體看看。

C#文檔XML標記的介紹

<c>:指示這行注釋標識為Code
 
<code>:指示多行注釋標識為Code
 
<example>:經常與<code>連用,用來給出如何使用某些成員的例子。
 
<exception>:指明一個成員會拋出哪些異常,經常與cref屬性連用。
 
<include>:指明注釋在哪些文件中,以及位置。
 
<list>:用來定義表頭,經常與<item>連用
 
<newpara>:內部使用,如<remarks>或<returns>。讓用戶有機會給注釋文本加入其他的結構。
 
<param>:說明參數的屬性,編譯器會檢查參數的合法性。如果通不過,會在文檔中產生!標識的警告。
 
<paramref>:類似<param>。
 
<permission>:標明用于成員的代碼存取的安全性。
 
<remarks>:用于描述class或其它類型的描述性文字,不涉及具體細節(如果是這樣,使用<summary>)。
 
<returns>:描述方法或函數的返回值。
 
<see>:指定一個鏈接。
 
<seealso>:指定要出現在See Also部分的文本。
 
<summary>:類型的描述性文字。它會被vs.net內置的IntelliSense使用并顯示在對應的類型中。(即在vs.net中擊鍵“.”出現的提示)
 
<value>:描述屬性。

標記及描述
 
cref:可用于任何標記來提供一個代碼元素的參考。編譯器將檢查這個代碼元素是否存在,如不存在則在文檔中用!標識。
 
name:用于<param>或<paramref>
 

C#文檔XML標記使用的例子

1.<param>標記

  1. /// <summary>  
  2.  
  3. /// A method with a string array param.  
  4.  
  5. /// </summary>  
  6.  
  7. /// <param name="ss"></param>  
  8.  
  9. public void Koo(string[] ss) {}  

2.<returns>標記

  1. /// <summary>  
  2.  
  3. /// A nonvoid method.  
  4.  
  5. /// </summary>  
  6.  
  7. /// <returns>The result of the operation.</returns>  
  8.  
  9. public int Noo() { return 0; }  

3.<exception>標記和cref 屬性:

  1. /// <summary>  
  2.  
  3. /// <exception cref="System.Exception">  
  4.  
  5. /// Throws a FileIOException when...  
  6.  
  7. /// </exception>  
  8.  
  9. /// </summary>  
  10.  
  11. public void Foo() {} 

4.<c>, <code>, 和<example>標記

  1. /// <summary>  
  2.  
  3. /// <c>Hoo</c> is a method in the <c>Class1</c> class.  
  4.  
  5. /// </summary>  
  6.  
  7. public void Hoo() {}  
  8.  
  9.    
  10.  
  11. /// <summary>  
  12.  
  13. /// The Joo method.  
  14.  
  15. /// <example>This example shows how to use Joo:  
  16.  
  17. /// <code>  
  18.  
  19. /// <newpara/>  
  20.  
  21. /// public static void Main()  
  22.  
  23. /// {  
  24.  
  25. ///     Console.WriteLine(Class1.Joo());  
  26.  
  27. /// }  
  28.  
  29. /// <newpara/>  
  30.  
  31. /// </code>  
  32.  
  33. /// </example>  
  34.  
  35. /// </summary>  
  36.  
  37. public static int Joo() { return 0; }  

5.<include> 標記語法:

  1. <include file=''''filename'''' path=''''tagpath[@name="id"]'''' />  
  2.  
  3.    
  4.  
  5. /// <include file=''''supporting.xml'''' path=''''MyDocs/MyMembers[@name="Class1"]/*'''' />  
  6.  
  7. class Class1{  
  8.  
  9. public static void Main() {}  
  10.  
  11. }  
  12.  
  13. supporting.xml  
  14.  
  15. <MyDocs>  
  16.  
  17.     <MyMembers name="Class1">  
  18.  
  19.         <summary>  
  20.  
  21.         The summary for this type.  
  22.  
  23.         </summary>  
  24.  
  25.     </MyMembers>  
  26.  
  27.     <MyMembers name="Class2">  
  28.  
  29.         <summary>  
  30.  
  31.         Another type description.  
  32.  
  33.         </summary>  
  34.  
  35.     </MyMembers>  
  36.  
  37. </MyDocs>  

6.<list>標記語法及應用

  1. <list type="bullet" │ "number" │ "table">  
  2.  
  3.     <listheader>  
  4.  
  5.         <term>term</term>  
  6.  
  7.         <description>description</description>  
  8.  
  9.     </listheader>  
  10.  
  11.     <item>  
  12.  
  13.         <term>term</term>  
  14.  
  15.         <description>description</description>  
  16.  
  17.     </item>  
  18.  
  19. </list>  
  20.  
  21.    
  22.  
  23. /// <remarks>Here is an example of a bulleted list:  
  24.  
  25. /// <list type="bullet">  
  26.  
  27. /// <item>  
  28.  
  29. /// <description>Item 1.</description>  
  30.  
  31. /// </item>  
  32.  
  33. /// <item>  
  34.  
  35. /// <description>Item 2.</description>  
  36.  
  37. /// </item>  
  38.  
  39. /// </list>  
  40.  
  41. /// </remarks>  
  42.  
  43. static void Main(string[] args) {}  

C#文檔XML標記的基本內容就向你介紹到這里,希望對你了解和學習C#文檔XML標記有所幫助。

【編輯推薦】

  1. C#調用瀏覽器的原理及實現淺析
  2. C#文件瀏覽器制作的詳細過程
  3. C#貨幣格式轉化實例解析
  4. 淺析C#文檔自動化實現
  5. C#文檔輸出的類型描述符淺析

 

責任編輯:仲衡 來源: host01.com
相關推薦

2009-08-24 17:24:28

C#創建XML文檔

2009-08-18 17:08:50

C#編寫XML文檔

2009-08-24 17:46:54

C#創建XML文檔

2009-08-12 15:26:38

C#讀取XML文檔

2009-08-18 17:05:08

C#操作xml文件

2009-08-12 16:26:30

C#讀取XML文檔

2009-08-26 11:32:37

C#打印文檔

2009-09-09 18:20:29

C# XML編程

2009-08-12 16:46:22

C#讀取XML文檔

2009-08-18 16:42:49

C# 操作XML

2009-09-01 09:12:37

C# System.X

2009-09-09 13:57:28

C# XML解析

2009-08-19 16:42:41

C#如何使用XML

2010-09-28 11:03:19

XML DOM

2009-08-18 16:30:41

C# 操作XML

2024-07-03 08:21:56

MDI窗體界面

2009-07-30 18:20:21

C#繼承

2009-08-24 11:23:41

C# TimeLabe

2009-09-01 16:07:04

C#命名規約

2009-09-07 16:13:56

C# MessageB
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 成人av电影在线观看 | 久久精品国产清自在天天线 | 一级黄色在线 | 日韩在线91 | 中文字幕一区二区三区在线视频 | 欧美国产视频 | av色站 | www.日本在线观看 | 蜜桃毛片 | 九九色综合 | 日韩中文字幕在线不卡 | 欧产日产国产精品视频 | 国产区精品| 午夜视频精品 | 国产精品www| 影音先锋欧美资源 | 欧美视频在线一区 | 日韩久久久久久 | 免费观看黄色片视频 | 中文字幕成人av | 男女午夜激情视频 | 亚洲精品自在在线观看 | 夜夜骑首页 | 成人激情视频免费在线观看 | 羞羞在线观看视频 | a级免费观看视频 | 成人h动漫精品一区二区器材 | 日韩在线精品 | 午夜精品久久久久久久久久久久久 | 欧美九九 | 国产乱码精品一区二区三区忘忧草 | 国产一区久久久 | 秋霞电影一区二区三区 | 黄色免费在线网址 | 亚洲欧美日韩精品久久亚洲区 | 逼逼网| 精品久久一区 | 日韩欧美一区二区三区免费看 | 久久亚洲欧美日韩精品专区 | 一区二区三区精品在线 | 日韩欧美二区 |