Hi Scott,
If my understanding is correct, you want to add export to image function to
your DSL project clients. If so, it is possible to do that.
Product group has explained it at:
http://social.msdn.microsoft.com/Forums/cs-CZ/vsx/thread/28657edc-abb7-45cb-
9334-05c4acf30c2f
Class Designer is currectly using API:
Microsoft.VisualStudio.Modeling.Diagrams.Diagram.CreateBitmap().
In your own diagram, you can call this API by passing a collection of
shapes (or the collection Diagram.NestedChildShapes if you want to include
all shapes on the diagram). It will return a Bitmap object which you can
choose to save it as a file.
If you want something even closer to the Class Designer experience, there
is a class called
Microsoft.VisualStudio.EnterpriseTools.Shell.DiagramExporter, in the
assembly Microsoft.VisualStudio.Modeling.Sdk.Shell.dll (already referenced
from your Designer project if you created a solution via the DSL designer
wizard). You can construct an instance of this class given an object that
implements IServiceProvider, and then it is just a matter of calling
DiagramExporter.ExportDiagram (or ExportDiagrams to do multiple diagrams at
once). This takes a path (paths) to your diagram file(s), the directory on
disk you where you want the diagrams exported, the image format you want to
use, and a boolean value indicating whether existing diagrams should be
overwritten.
Please let me know if you encounter any problem when implementing it.
Thanks,
Hongye Sun (***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within?2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.