C#注释含义(XML注释)标签及其含义(一)

<c>(C# 编程指南)  
<c>text</c>
参数
text 
希望将其指示为代码的文本。
备注
<c> 标记为您提供了一种将说明中的文本标记为代码的方法。使用 <code> 将多行指示为代码。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
C#

 
  

//  compile  with:  /dococFileName.xml   
///  text  for  class  TestClass 
public  class  TestClass 

     ///  <summary><c>DoWork</c>  is  a  method  in  the  <c>TestClass</c>  class.
      ///  </summary>
      public  static  void  DoWork(int  Int1) 
     { 
     } 
      ///  text  for  Main
      static  void  Main() 
     { 
     } 
}


<para>(C# 编程指南)  
<para>content</para>
参数
content 
段落文本。
备注
<para> 标记用于诸如<summary>、<remarks> 或 <returns> 等标记内,使您得以将结构添加到文本中。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
有关使用 <para> 的示例,请参见 <summary>。
<see>(C# 编程指南)  
<see  cref="member"/>
参数
cref = "member" 
对可以通过当前编译环境进行调用的成员或字段的引用。编译器检查给定的代码元素是否存在,并将 member 传递给输出 XML 中的元素名称。 应将 member 放在双引号 (" ") 中。
备注
<see> 标记使您得以从文本内指定链接。使用 <seealso> 指示文本应该放在“另请参见”节中。
使用 /doc 进行编译可以将文档注释处理到文件中。
有关使用 <see> 的示例,请参见 <summary>。
示例
下面的示例演示如何对泛型类型进行 cref 引用。
C#
 
  

//  compile  with:  /dococFileName.xml  
  
//  the  following  cref  shows  how  to  specify  the  reference,  such  that, 
//  the  compiler  will  resolve  the  reference 
///  <summary  cref="C{T}"> 
///  </summary> 
class  A  {  } 
 
//  the  following  cref  shows  another  way  to  specify  the  reference,   
//  such  that,  the  compiler  will  resolve  the  reference 
//  <summary  cref="C  <  T  >">
  
//  the  following  cref  shows  how  to  hard-code  the  reference 
///  <summary  cref="T:C`1"> 
///  </summary> 
class  B  {  } 
 
///  <summary  cref="A"> 
///  </summary> 
///  <typeparam  name="T"></typeparam> 
class  C<T>  {  }


<code>(C# 编程指南)  
<code>content</code>
参数
content 
希望将其标记为代码的文本。
备注
<code> 标记为您提供了一种将多行指示为代码的方法。使用 <c> 指示应将说明中的文本标记为代码。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
有关如何使用 <code> 标记的示例,请参见 <example> 主题。
<param>(C# 编程指南)  
<param  name=\’name\’>description</param>
参数
name 
方法参数名。将此名称用双引号括起来 (" ")。
description 
参数说明。
备注
<param> 标记应当用于方法声明的注释中,以描述方法的一个参数。
有关 <param> 标记的文本将显示在 IntelliSense、对象浏览器和代码注释 Web 报表中。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
C#
 
  

//  compile  with:  /dococFileName.xml  
  
///  text  for  class  TestClass 
public  class  TestClass 

     ///  <param  name="Int1">Used  to  indicate  status.</param>
      public  static  void  DoWork(int  Int1) 
     { 
     } 
     ///  text  for  Main
      static  void  Main() 
     { 
     } 
}


<seealso>(C# 编程指南)  
<seealso  cref="member"/>
参数
cref = "member" 
对可以通过当前编译环境进行调用的成员或字段的引用。编译器检查到给定代码元素存在后,将 member 传递给输出 XML 中的元素名。必须将 member 括在双引号 (" ") 中。 
有关如何创建对泛型类型的 cref 引用的信息,请参见 <see>(C# 编程指南)。
备注
<seealso> 标记使您得以指定希望在“请参见”一节中出现的文本。使用 <see> 从文本内指定链接。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
有关使用 <seealso> 的示例,请参见 <summary>。
<example>(C# 编程指南)  
<example>description</example>
参数
description 
代码示例的说明。 
备注
使用 <example> 标记可以指定使用方法或其他库成员的示例。这通常涉及使用 <code> 标记。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
C#
 
  

//  compile  with:  /dococFileName.xml  
  
///  text  for  class  TestClass 
public  class  TestClass 

     ///  <summary>
      ///  The  GetZero  method.
      ///  </summary>
      ///  <example>  This  sample  shows  how  to  call  the  GetZero  method.
      ///  <code>
      ///  class  TestClass  
      ///  {
      ///      static  int  Main()  
      ///      {
     

转载于:https://www.cnblogs.com/greatwang/archive/2011/11/09/2648251.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值