IntelliSense和折叠的XML注释未在设计视图中根据需要显示

时间:2018-05-16 08:29:32

标签: vb.net visual-studio-2015 intellisense xml-documentation

我正在尝试为IntelliSense创建XML注释,并使用以下方法执行此操作:

'''<summary>Units
''' <para>MinOccurs: '0'</para>
''' </summary>
Public Property S_Units As String = Nothing

倒塌看起来像这样:

'''<summary>BinLocation
Public Property B_BinLocation As String = Nothing

我想要做的是添加一个XMLcomment,当它被折叠时,它模拟了在下面的Microssoft的String.Padright属性的系统属性上向下钻取时的显示方式(我知道这只是常规的)评论,但要求相同的效果)

'
' Summary:
'     Returns a new string that left-aligns the characters in this string by padding
'     them on the right with a specified Unicode character, for a specified total length.
'
' Parameters:
'   totalWidth:
'     The number of characters in the resulting string, equal to the number of original
'     characters plus any additional padding characters.
'
'   paddingChar:
'     A Unicode padding character.
'
' Returns:
'     A new string that is equivalent to this instance, but left-aligned and padded
'     on the right with as many paddingChar characters as needed to create a length
'     of totalWidth. However, if totalWidth is less than the length of this instance,
'     the method returns a reference to the existing instance. If totalWidth is equal
'     to the length of this instance, the method returns a new string that is identical
'     to this instance.
'
' Exceptions:
'   T:System.ArgumentOutOfRangeException:
'     totalWidth is less than zero.
Public Function PadRight(totalWidth As Integer, paddingChar As Char) As [String]

倒塌看起来像这样:

...Public Function PadRight(totalWidth As Integer) As [String]

注意椭圆与Function声明一致 如果我模拟这里使用的结构,我得到以下内容:

'
' Summary:
'    Summary Line
'
' Returns:
'     Returns Line
Public Property S_Units As String = Nothing

导致崩溃:

' ...
Public Property S_Units As String = Nothing

注意Property声明上方的椭圆。 值得注意的是,我从System命名空间获取了String样本,VS选项卡显示String [from metadata]

这可能是它显示不同的原因还是我错过了某些导入或引用?

我能尝试一下吗?

1 个答案:

答案 0 :(得分:0)

您将特殊的可视化工具视图混淆为xml注释的可选视图。

在VS2015之前,VB和&#34; Go To Definition&#34;会把你带到&#34;对象浏览器&#34;。此视图由&#34;文本编辑器&#34;选项&#34;转到定义&#34;。

enter image description here

正如描述所述,该视图是由类型的元数据和xml文档文件(如果它存在于参考路径中)构成的。您可以在文章中了解此元数据:Metadata and Self-Describing Components

无法为主代码编辑器启用此视图。如果您要将代码编译到库并在另一个解决方案中引用它,则在单击&#34;转到定义&#34;。

时会看到此可视化工具视图。