<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()
/// {