Manage Outputs
Managing your CodeSmith Generator Project is simple to do, and best of all, you don't have to be in CodeSmith Generator to do it. That's why we've exposed the ability to manage your Generator Project File from just about anywhere, Windows Explorer, and Visual Studio. Meaning whatever interface you're seeing the project file, you can Add, Edit or Delete via the Manage Outputs dialog. Code Generation has never been easier.
In the following sections we will show you how to use the full power of Manage Outputs.
Configuring your Options
There are several options you have the ability to configure, initially, you need to add at least one Output.
Outputs Window | Are the current configured Outputs for your CodeSmith Generator Project. If an output does not specify a CodeSmith Generator template to use, the Output will use the Default Template. (depicted above) |
Add Button | Opens the Add Output Form so that you can add a new output with an existing template or use the default template. For more information read the Add/Edit Outputs section below. |
Edit Button | Opens the Edit Output Form which you can edit the output options or template properties. For more information read the Add/Edit Outputs section below. |
Copy Button | Creates a copy of a selected output. This is especially useful if you are creating many outputs that use the same template, but use a single different piece of meta-data to differentiate from. You would then only have to change the one property for all of the copied outputs. |
Delete Button | Deletes an Output from your CodeSmith Generator Project. |
Generate Selected Button | Generates the output for the selected template. |
Generate Button | Begins the generation process for this CodeSmith Generator Project. This is the same as selecting Generate Output. |
Project Options Button | Opens the Project Options dialog. |
OK Button | Persists all modifications that were made on the form. |
Cancel Button | Cancels any changes from the form and closes the window. |
Add/Edit Outputs
To open the Edit Output dialog, you can click on the edit icon in the Manage Outputs toolbar or double click on an output listed in the Outputs list.
There are four panels that cover all of the options for configuring an Output. Below is the entire Add/Edit Output Form.
Choose a Template
If a Template has been configured from in the Main Manage Outputs screen, then you will see the template name listed under the Use Default Template option. Otherwise, you will have a File Chooser control to select your template that you want the output to be generated from.
Choose an Output
Choosing an output requires you to name the Output file you are wanting to use. The default Output name is created by the template you are using.
Optional: Choose a Merge Strategy
If your template uses a merge strategy, either InsertRegion or PreserveRegions, you would enter the pattern here.
Configuring the Property Sheet
The right pane is a familiar property of the template you have chosen. You would fill in the necessary values for your template to run. The top shaded yellow area shows the property sheet options.