Generate dialog box
Use the Generate dialog box to set the target language and project location and to select the classes for which you want code to be generated.
You can add the selected classes to a Visual Studio project, creating a project-level folder, and you can add a solution folder.
Target Language
Select the language in which you want code to be generated. From the list, you can select C#, C++, or Visual Basic, and you can change your selection later if necessary.
Project
Name
Specifies the name of the project. To activate this box, click the Add Classes to Visual Studio Project check box.
Location
Specifies the path to which generated code files are automatically saved. To browse for the project folder, click the Browse button.
Add Classes to Visual Studio Project
Select this check box to add the classes generated as code to a new project in Visual Studio. After you select this check box, you can:
-
Edit the project name.
-
Select a Visual Studio template on which to base your code.
-
Create a solution folder.
-
Edit the solution name.
Template
Specifies the Visual Studio template to be used with the generated code. The template list varies depending on the target language.
For example, if you are generating code in Visual Basic or Visual C#, the Windows Application, Console Application, Class Library, and Windows Control Library templates are listed, among others. If you are generating code in Visual C++, the list includes templates for an ATL Project, an ATL Server Project, a Managed C++ Application, and many others.
Depending on the template you choose, Visual Studio generates additional files required for the specific application type.
Solution
Name
Specifies the name of the solution, if any. To create a solution or edit the solution name, click Add Classes to Visual Studio Project.
Create directory for solution
To create a solution folder, click the Create directory for solution check box, and then in the Name box, type a name for the solution.
Project will be created at <<file path>>
Dynamic text showing the location of the files created as the path is generated. As you edit, changes you make to either the project name or the solution name are reflected in this text.
Select classes for code generation
In the tree view, make selections for the class elements you want included in the code that is generated. Expand or collapse the view as needed to select items.
When you select the top-level check box, all of the elements under that item are also selected by default. You can then individually clear the check box for any element that you do not want to include in the generated code
Note Static Model, Top Package, and Class1 are the default names of these UML elements. The names can be edited in the UML Model Explorer, and if you change them, the revised names appear in the list.
No comments:
Post a Comment