Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Managing your CodeSmith Project is simple to do, and best of all, you don't have to be in CodeSmith to do it. That's why we've exposed the ability to manage your project from just about anywhere, Windows Explorer, CodeSmith Studio and Visual Studio. Meaning whatever interface you're seeing the project file, you can edit, change outputs, Add Outputs, change properties, or even Merge Regions. Code Generation has never been easier.

Image Modified

Manage Outputs from Visual Studio Image Modified

To manage a CodeSmith Project, you can use the Right-Click context menu of a CodeSmith Project file from the Solution Explorer window.(Depicted on the right)

...

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 Project. If an output does not specify a CodeSmith 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.
(See Add Outputs Below)

Edit Button

Opens the Edit Output Form which you can edit the output options or template properties.
(See Edit Outputs 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 Project.

Generate Selected Button

Generates the output for the selected template.

Generate Button

Begins the generation process for this CodeSmith 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.

...

There are four panels that cover all of the options for configuring an Output. Below is the entire Add/Edit Output Form.

Image Modified

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.

Image Modified

Choose an Output

...

NOTE: If you have a template that does not have an output, this field will be ignored.

Image Modified

Optional: Choose a Merge Strategy

If your template uses a merge strategy, either InsertRegion or PreserveRegions, you would enter the pattern here.

Image Modified

Configuring the Property Sheet

...

NOTE: Any Required fields missing will throw an error when you attempt to save the Output changes.

Image Modified