且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为现有的源代码创建一个类图

更新时间:2023-12-02 22:00:58

您可以使用在线工具

单击此处
You can use the online tool

Click Here


如果您想编写自己的代码,可以使用反射.查看类型System.Type: http://msdn.microsoft.com/en-us/library/system.type.aspx [ ^ ].

它具有有关基本类型,属性,字段,构造函数,方法,属性等的全面信息.非公共成员也可以访问.这些方法的所有返回类型也都具有全面的信息.换句话说,您可以收集有关代码的全面元数据.这足以构建完整的类图.

对于图形表示,我不了解WPF.

实际上,我不知道真正好的图表实用程序. Visual Studio可以做到,但是对我来说使用它并不值得.它不符合UML表示法(也许还不错),而且重要的是,没有办法将其导入任何种类的矢量图形(为什么在地球上-我不知道!Microsoft可以完美地完成所有工作,例如XAML形式.)

另外,请查看Reflector, http://en.wikipedia.org/wiki/.NET_Reflector [ ^ ].

—SA
If you want to write your own code, you can use Reflection. Look at the type System.Type: http://msdn.microsoft.com/en-us/library/system.type.aspx[^].

It has comprehensive information on base type, properties, fields, constructors, methods, attributes, etc. Non-public members are also accessible. All return types of those methods also have comprehensive information. In other word, you can collect comprehensive meta-data about your code. This is more than enough to build a complete class diagram.

For graphics representation, I don''t know anything better then WPF.

Actually I don''t know really good diagramming utility. Visual Studio does it, but to me using it does not worth the effort. It does not comply UML notation (maybe this is not bad) and, importantly, there is no way to import it to any kind of vector graphics (why on Earth — I don''t know! Microsoft has everything to do it perfectly, in the form of XAML, for example).

Also, look at Reflector, http://en.wikipedia.org/wiki/.NET_Reflector[^].

—SA


直接在解决方案上单击鼠标右键,然后单击查看类图"
Simpily RightClick on the Solution an click View Class Diagram