Edit

Share via


<typeparamref> (Visual Basic)

Formats a word as a type parameter.

Syntax

<typeparamref name="name"/>  

Parameters

name: The name of the type parameter to refer to. Enclose the name in double quotation marks (" ").

Remarks

The <typeparamref> tag gives you a way to indicate that a word is a type parameter. The XML file can be processed to format this type parameter in some distinct way, for example in italics.

Compile with -doc to process documentation comments to a file.

Example

This example uses the <typeparamref> tag to refer to the T type parameter.

''' <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

See also