我可以以编程方式从Visual Studio 2008导出类图? [英] Can I programmatically export class diagrams from Visual Studio 2008?
本文介绍了我可以以编程方式从Visual Studio 2008导出类图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以通过右键单击表面并选择将图形导出为图像,从Visual Studio导出类图。
I can export a class diagram as an image from Visual Studio by right-clicking on the surface and choosing "Export Diagram as Image..."
是否有通过命令行这样做的方法?我希望能够生成所有的类图作为图像,所以我可以将它包含在.chm中。我正在建立沙堡。
Is there a way to do this through command line? I'd like to be able to generate all of my class diagrams as images so I can include it in the .chm I am building w/ Sandcastle.
推荐答案
在搜索完整的一天之后找到它。如果有人再次遇到这种情况:
Found it after a full day of searching. In case anyone ever comes across this again:
有两种方法:
- Microsoft.VisualStudio.Modeling.Diagrams.Diagram.CreateBitmap()可让您传递形状集合并将其作为位图导出
- Microsoft.VisualStudio.EnterpriseTools.Shell.DiagramExporter 稍微复杂一些,但是您可以创建自己的IServiceProvider实现,然后可以选择位置,文件格式等。
- Microsoft.VisualStudio.Modeling.Diagrams.Diagram.CreateBitmap() lets you pass in a collection of shapes and export them as a bitmap
- Microsoft.VisualStudio.EnterpriseTools.Shell.DiagramExporter is slightly more complicated, but lets you create your own implementation of IServiceProvider, then you can choose locations, file formats, etc.
这篇关于我可以以编程方式从Visual Studio 2008导出类图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文