共用方式為


<typeparamref> (Visual Basic)

將單字格式化為類型參數。

語法

<typeparamref name="name"/>  

參數

name:要參照的類型參數名稱。 將名稱括在雙引號 (“ ”) 中。

備註

標籤 <typeparamref> 可讓您指出單字是類型參數。 可以處理 XML 檔案,以某種不同的方式格式化此類型參數,例如斜體。

使用 -doc 進行編譯,以處理檔案的檔註解。

Example

此範例使用標籤來 <typeparamref> 參照 T type 參數。

''' <summary>
''' Compares two items of type <typeparamref name="T"/>.
''' </summary>
''' <typeparam name="T">The type of items to compare.</typeparam>
''' <param name="item1">The first item of type <typeparamref name="T"/>.</param>
''' <param name="item2">The second item of type <typeparamref name="T"/>.</param>
''' <returns>True if the items are equal, False otherwise.</returns>
Public Function CompareItems(Of T As IComparable)(ByVal item1 As T, ByVal item2 As T) As Boolean
    Return item1.CompareTo(item2) = 0
End Function

另請參閱