共用方式為


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

<typeparam name="name">description</typeparam>

參數

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

  • description
    型別參數的說明。

備註

<typeparam> 標記應該用在泛型型別或方法宣告的註解中,以說明型別參數。 為泛型型別或方法的每個型別參數加入標記。

如需詳細資訊,請參閱 泛型 (C# 程式設計手冊)

<typeparam> 標記的文字會顯示在 IntelliSense (Object Browser Window程式碼結構 Web 報告) 中。

使用 /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# 程式設計手冊

其他資源

C# 參考