Programmatically render (export as Image) Class Diagrams (Visual Studio) - visual-studio

In my projects I actively use class diagrams (*.cd). I'd like to export my diagrams programmatically (e.g. during the build, or on my CI server) in order to use them on Wiki pages, etc.
I know that I can do it manually via "Export Diagram As Image" dialog
But the diagrams change rather often so I'm curious is there a way to do it programmatically (using any library, utility, etc)?

But the diagrams change rather often so I'm curious is there a way to do it programmatically (using any library, utility, etc)?
you can use method named GetObject to get the Diagram of the underlying implementation. This type has a method CreateBitmap. The following link provide a complete code sample for your reference.
https://msdn.microsoft.com/en-us/library/ff469815.aspx
Update:
The UML diagrams support are:
1.Class Diagram
2.UseCase Diagram
3.Sequence Diagram
4.Component Diagram
5.Activity Diagram
6.Layer Diagram

Related

How to (re-)generate ActiveX Wrapper Classes with Visual Studio 10

... especially in the case of Non-Dialog Containers?
Hi folks,
I want to use ActiveX controls that are created in a view, not in a Dialog container, as described in http://msdn.microsoft.com/library/191es2w5%28v=vs.100%29.aspx . But in that article, the existence of the wrapper class is already supposed / not mentioned how to generate it. In the project that was handed me over, i found such generated classes.
For Dialog-Containers, the generator runs when I add a control varaible for the embedded activeX control, (again: not mentioned in msdn doc http://msdn.microsoft.com/library/w98bewhf%28v=vs.100%29.aspx ). Workaorunds are possible (eg. creating a useless dialog just for that purpose), but there must be a "clean" way in Visual Studio!? I am a little bit disappointed by the MS-Documentation I found. If somebody could give me a hint, you could make me happy...

Generate PL/SQL from UML

Are there any tool (open source or freeware) to generate the PL/SQL code (with objects) from a UML Diagram?
Thanks!
You may try to write your own transformation through the Eclipse Modeling Tool Project. You need Papyrus, as UML graphical editor, to create UML models conform to the Eclipse's ECORE (which is the Eclipse implementation of the MOF meta-meta-model). Then you can write Acceleo scripts describing how to turn UML elements (i.e. classes, stereotypes, properties, operations, etc.) into the code you need (i.e. PL/SQL). Acceleo is the Eclipse implementation of the MOFM2T language which is the OMG standard for model to text transformations (http://www.omg.org/spec/MOFM2T).
I think it would be easier to generate java code from an UML diagram then to add ORM annotations in your java code and then use the dali Eclipse project to generate your SQL code.

Visual Studio UML designer - data types

I'm using the Visual Studio UML designer to create some class diagrams. Since I would like to generate code from the diagrams it need to be accurate.
Now I'm trying to define the type of some properties of my classes, but I can't find a way to give them a type different from bool, string, int and UmlimitedNatural (and my own types of course). I found a tutorials that claims I would have to create custom stereotypes. Really? I mean it's VS, I'm just asking for some build in reference/value types like byte or GUID.
Do I overlook a hidden switch or if there is really now way to tell VS to bring up some commonly used types does anyone know a source for UML profiles that provide it? And how I can define more complex types like generics?
UML is implementation language neutral. Since types differ by platforms it is necessary to define an implementation language profile for any UML tool. Most UML CASE tools include the option to choose the language and apply a built in profile, which should make them available.

Generate UML Class Diagram for one project in solution

I want to ask How can I generate UML Class Diagram for only one project in solution ? When I generate by click Architecture -> Generate Dependency Diagram, I get diagram of solution, I have 8 projects in solution, so diagram looks terible.
I programming in c# and use VS 2010 Ulimate
Can I generate diagram only for some classes ? for example for classes in one folder ?
I don't know this tool but did you try to drag and drop manually the class you want to display into an empty class diagram ? It usually works.
If you have an MSDN subscription, you can install the Visual Studio 2010 Feature Pack 2, so that you can do this: How to: Create UML Class Diagrams from Code.

setup mfc project

A word or two about project I have to make.
I have a list of products (XML formatted), and I have to make a bar code of that list.
Here are the requirements:
Technology has to be MFC, VS 2005 or VS2008
All functionality must be in one dll
Same solution should have a simple tester for the dll
I will use pdf417. http://en.wikipedia.org/wiki/PDF417 http://sourceforge.net/projects/pdf417lib/
Also, I would like to provide an interface, so that different bar codes can be implemented in future.
For example, my dll has "Write" method which is implemented in a separate file for pdf417 and in a separate file for some other bar code, so that user can choose which bar code to use.
Since I have no knowledge of mfc, I really don't know how to even start. I read some tutorials, created the dll with some dummy method, and then tried to use it in tester application, but no luck.
I know that this is a "needle in a haystack" type of a question, but if someone could help me how to setup/architect this project I would be very grateful.
Thanks,
Marko
I don't see how you benefit from using MFC if your DLL's client is not an MFC app. You are better off using a standard C interface in your exported functions if you want to support non-MFC clients. Just create a Win32 project and choose the project type as DLL, then the wizard will generate some example exported function for you. Follow the examples to create your own export functions.

Resources