IntelliSense 和折叠 XML 评论在设计视图中未按需要显示
IntelliSense and collapsed XML Comments not displayed as needed in designview
我正在尝试为 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
我想做的是添加一个 XML 评论,当它被折叠时,它模拟在像微软 [=17] 这样的系统 属性 上向下钻取时它的显示方式=] 属性 下面(我知道这只是常规注释,但需要相同的效果)
'
' 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]
注意函数声明中的椭圆
如果我模拟这里使用的结构,我会得到以下结果:
'
' Summary:
' Summary Line
'
' Returns:
' Returns Line
Public Property S_Units As String = Nothing
导致崩溃:
' ...
Public Property S_Units As String = Nothing
注意 属性 声明上方的椭圆。
1 值得注意的一点是我从 System
命名空间获取字符串示例并且 VS 选项卡显示 String [from metadata]
这可能是它显示不同的原因,还是我在某处遗漏了一些导入或引用?
有什么我可以尝试的吗?
您将特殊的可视化工具视图混淆为 xml 评论的可选视图。
在 VS2015 之前,VB 不存在这个特定的可视化工具,"Go To Definition" 会将您带到 "Object Browser"。此视图由 "Text Editor" 选项控制 "Go To Definition"。
如描述所述,此视图是根据类型的元数据和 xml 文档文件(如果它存在于参考路径中)构建的。您可以在文章中阅读有关此元数据的信息:Metadata and Self-Describing Components.
无法为主代码编辑器启用此视图。如果您要将代码编译为库并在另一个解决方案中引用它,您将在单击 "Go To Definition".
时看到此可视化工具视图
我正在尝试为 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
我想做的是添加一个 XML 评论,当它被折叠时,它模拟在像微软 [=17] 这样的系统 属性 上向下钻取时它的显示方式=] 属性 下面(我知道这只是常规注释,但需要相同的效果)
'
' 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]
注意函数声明中的椭圆 如果我模拟这里使用的结构,我会得到以下结果:
'
' Summary:
' Summary Line
'
' Returns:
' Returns Line
Public Property S_Units As String = Nothing
导致崩溃:
' ...
Public Property S_Units As String = Nothing
注意 属性 声明上方的椭圆。
1 值得注意的一点是我从 System
命名空间获取字符串示例并且 VS 选项卡显示 String [from metadata]
这可能是它显示不同的原因,还是我在某处遗漏了一些导入或引用?
有什么我可以尝试的吗?
您将特殊的可视化工具视图混淆为 xml 评论的可选视图。
在 VS2015 之前,VB 不存在这个特定的可视化工具,"Go To Definition" 会将您带到 "Object Browser"。此视图由 "Text Editor" 选项控制 "Go To Definition"。
如描述所述,此视图是根据类型的元数据和 xml 文档文件(如果它存在于参考路径中)构建的。您可以在文章中阅读有关此元数据的信息:Metadata and Self-Describing Components.
无法为主代码编辑器启用此视图。如果您要将代码编译为库并在另一个解决方案中引用它,您将在单击 "Go To Definition".
时看到此可视化工具视图