Skip to content

Commit fe41b16

Browse files
CopilotBillWagner
andcommitted
Add missing typeparamref XML documentation tag for Visual Basic
Co-authored-by: BillWagner <[email protected]>
1 parent 904fc86 commit fe41b16

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

docs/visual-basic/language-reference/xmldoc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The Visual Basic compiler can process documentation comments in your code to an
3737
- [\<seealso>](seealso.md) <sup>1</sup>
3838
- [\<summary>](summary.md)
3939
- [\<typeparam>](typeparam.md) <sup>1</sup>
40+
- [\<typeparamref>](typeparamref.md)
4041
- [\<value>](value.md)
4142

4243
(<sup>1</sup> The compiler verifies syntax.)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
description: "Learn more about: <typeparamref> (Visual Basic)"
3+
title: "<typeparamref>"
4+
ms.date: 07/20/2015
5+
helpviewer_keywords:
6+
- "typeparamref XML tag"
7+
- "<typeparamref> XML tag"
8+
ms.assetid: 8979d53b-beb1-41b7-b41e-6bbea1c17a03
9+
---
10+
# \<typeparamref> (Visual Basic)
11+
12+
Formats a word as a type parameter.
13+
14+
## Syntax
15+
16+
```xml
17+
<typeparamref name="name"/>
18+
```
19+
20+
## Parameters
21+
22+
`name`
23+
The name of the type parameter to refer to. Enclose the name in double quotation marks (" ").
24+
25+
## Remarks
26+
27+
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.
28+
29+
Compile with [-doc](../../reference/command-line-compiler/doc.md) to process documentation comments to a file.
30+
31+
## Example
32+
33+
This example uses the `<typeparamref>` tag to refer to the `T` type parameter.
34+
35+
[!code-vb[VbVbcnXmlDocComments#9](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb#9)]
36+
37+
## See also
38+
39+
- [XML Comment Tags](index.md)

samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,20 @@ Public Class Test
168168
' Code goes here.
169169
End Sub
170170
' </snippet7>
171+
172+
' <typeparamref>
173+
' <snippet9>
174+
''' <summary>
175+
''' Compares two items of type <typeparamref name="T"/>.
176+
''' </summary>
177+
''' <typeparam name="T">The type of items to compare.</typeparam>
178+
''' <param name="item1">The first item of type <typeparamref name="T"/>.</param>
179+
''' <param name="item2">The second item of type <typeparamref name="T"/>.</param>
180+
''' <returns>True if the items are equal, False otherwise.</returns>
181+
Public Function CompareItems(Of T As IComparable)(ByVal item1 As T, ByVal item2 As T) As Boolean
182+
Return item1.CompareTo(item2) = 0
183+
End Function
184+
' </snippet9>
171185
End Class
172186

173187
' <code> 925e5342-be05-45f2-bf66-7398bbd6710e.xml

0 commit comments

Comments
 (0)