This article was originally published by Đonny as <completionlist> community content contribution on MSDN page Recommended XML Tags for Documentation Comments (Visual Basic).
Have you ever wondered how it is possible that class System.Drawing.Color behaves in Visual Basic editor like enumeration though it is not enumeration? I mean - when you have code like this:
Dim col As Color Col = |When you type 2nd line and you are at place of | list of known colors appears.This nice undocumented feature of Visual Studio is not achieved via custom attributes as you may guess but via XML Docummentation. When you look for <member name="T:System.Drawing.Color"> in c:\Windows\Microsoft.net\Framework\v2.0.50727\en\System.Drawing.xml you can see tag applied on it you probably have never seen before:
The tag <completionlist> specifies that whenever value of type it is applied onto is required all public static (Shared in Visual Basic) properties (with getter, no index) and fields of type specified in cref attribute are offered as if type specified in cref is enum and those properties and fields are enum members.<completionlist cref="T:System.Drawing.Color" />
''' <completionlist cref="KnownCssAttributes"/> Public Class CssAttribute Public Sub New (ByVal Name$) End Sub Public Shared Widening Operator CType(ByVal cssName$) As CssAttribute Return New CssAttribute(cssName) End Operator End Class Public Module KnownCssAttributes Public ReadOnly BackgroundColor As CssAttribute = New CssAttribute("background-color") Public ReadOnly Property Padding As CssAttribute Get Return New CssAttribute("padding") End Get End Property Public Const MozBorderRadius$ = "-moz-border-radius" End Module
Now when you type something like
Dim h As CssAttribute = |And your cusror is in position of | you are offered BackgroundColor, Padding and MozBorderRadius.