我需要迅速适应用 VB 编写的现有系统。对于一些较大的 VB 表单类(2000 多行)和其他类,我想获得它们的概述,其中包含区域和其中的声明(方法、函数、属性和类级变量),我可以打印/保存以供参考。
目前我可以通过删除方法体和删除注释来手动实现这一点。我还可以使用一些高级正则表达式(正则表达式)搜索来标记所需的行,然后过滤掉其余的行。可以使用Reflection获得声明列表,但我认为它总是没有#Region
信息。
是否有任何 VisualStudio 功能或外部工具可以为我创建这样的“类图”?
换句话说,我想生成类似于 C/C++ 头文件但用于 VB 并且还包括
#Region
信息的文件。
预期输出示例:
Public Class frmXY_Sample1
#Region "Internal Variables"
#Region "Form Common"
Private _Connection As SqlClient.SqlConnection
Private _DataFormType As XYZ.xyzDataFormType
Private AllowEvents As Boolean
#End Region
#Region "Instance Data"
Private _Instance As thisEnt
#End Region
#End Region
#Region "Form Events"
Private Sub frmXY_SomeForm1_Load(sender As Object _
#End Region
#Region "Save..."
Private Sub ID_Save_Click(sender As System.Object, e As System.EventArgs) Handles ID_Save.Click
#End Region
#Region "FormTabs"
#Region "Tab 'SampleTab1'"
Private Sub TS_TAB1_AddNew_Click(sender As System.Object, e As System.EventArgs) _
Private Sub TS_TAB1_Detail_Click(sender As System.Object, e As System.EventArgs) _
#End Region
#Region "Tab 'SampleTab2'"
Private Sub TS_TAB2_Detail_Click(sender As System.Object, e As System.EventArgs) _
Private Sub TS_TAB2_Refresh_Click(sender As System.Object, e As System.EventArgs) _
Private Sub TAB2_Grid_CellPainting(sender As System.Object _
#End Region
谢谢你。