<typeparamref> (C# 程式設計手冊)

<typeparamref name="name"/>

參數

  • name
    型別參數的名稱。 以雙引號 (" ") 將名稱括起來。

備註

如需泛用型別和方法中型別參數的詳細資訊,請參閱泛型

使用這個標記讓文件檔的使用者能夠以某些個別方法 (例如斜體) 格式化文字。

使用 /doc 進行編譯,將文件註解處理為檔案。

範例

// 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];
    }
}

請參閱

參考

建議使用的文件註解標籤 (C# 程式設計手冊)

概念

C# 程式設計手冊