<typeparamref>(C# 编程指南)<typeparamref> (C# Programming Guide)

语法Syntax

<typeparamref name="name"/>  

参数Parameters

name
类型参数的名称。The name of the type parameter. 用双引号 (" ") 将名称引起来。Enclose the name in double quotation marks (" ").

备注Remarks

有关泛型类型中的类型参数及方法的详细信息,请参阅泛型For more information on type parameters in generic types and methods, see Generics.

通过此标记,文档文件的使用者可显著设置字体格式,例如采用斜体。Use this tag to enable consumers of the documentation file to format the word in some distinct way, for example in italics.

使用 -doc 进行编译以便将文档注释处理到文件中。Compile with -doc to process documentation comments to a file.

示例Example

// compile with: -doc:DocFileName.xml 

/// comment for class
public class TestClass
{
    /// <summary>
    /// Creates a new array of arbitrary type <typeparamref name="T"/>
    /// </summary>
    /// <typeparam name="T">The element type of the array</typeparam>
    public static T[] mkArray<T>(int n)
    {
        return new T[n];
    }
}

请参阅See also