简体   繁体   中英

How can I get a list of all classes and methods used in a Visual Studio project?

是否有用于Visual Studio 2008的报表工具,可以生成项目中使用的所有类和方法的列表?

NDepend can create such reports . It has its own query language, so that even you can select types/members depending on some metadata.

You can use reflection if you need all the names, something like (in VB.NET)

 Dim myType As Type = GetType(myclassname)
 Dim myArrayMethodInfo As MethodInfo() = myType.GetMethods(BindingFlags.Public Or BindingFlags.Instance Or BindingFlags.DeclaredOnly)
    For i As Integer = 0 To myArrayMethodInfo.Length - 1
        Dim mi As MethodInfo = CType(myArrayMethodInfo(i), MethodInfo)            
        Debug.Print(mi.Name)                       
    Next i

Or you can use a 3rd party tool such as OxyProject Metrics if you just want to count them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM