Can we generate code?

Is there a way to generate code from a class diagram? Given a project without the type on a class diagram, wouldn't it be nice to be able to generate that stub? If there is a way to do this, please let me know. If not, why not?
Thanks!
[247 byte] By [dwj] at [2008-2-10]
# 1
Hi,

code is automatically generated if you drag a class onto the class diagram in your solution.

rgerbig at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Class Designer...
# 2
But I'm referring to the situation where you don't have any source files. Is there a way to generate code from scratch using the diagram?
dwj at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Class Designer...
# 3
Hi,

this works with an empty project, too.

rgerbig at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Class Designer...
# 4
Hi,
You should be able to create new types by dragging the item from the toolbox (it should be visible when you have a class diagram open if not, you can bring it up by going to the View menu and selecting Toolbox).

In the RTM bits, you will be able to create new types from the context menu (right click) on the class diagram design surface.

Once you create a type, you can add members either from the context menu for the shape or from the class details window (again this should be visible when the class diagram is on, if not, you can bring it up from the context menu for the shape).

Thanks,
Ramesh Rajagopal.
Class Designer Team.

RameshRajagopal at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Class Designer...

Visual Studio

Site Classified