Here is my contribution to the CodeSmith Community.
It's an add-in to VS.NET to generate code, base on CodeSmith template, to the active window.
After the installation, you will find in the Tools menu, two new items: "AutoCodeSmith" and "AutoCodeSmith Settings".
You use the settings form to to give an alias to a template file (.cst).
Example
Alias=a, template= c:\codesmithtemplate\templateA.cst
In the active Window, you can enter this line
parm1 parm2 parm3 a <ctrl-enter>
This will replace that line with the result of the codesmith template where property1 to property3 of the template are replace, in that order, by parm1 to parm3.
I'll give you, with the installation, two simple templates: Property.cst and RegionTemplate.cst, respectivly with p and r alias (see in the settings form).
Look at the RegionTemplate.cst template. The [@] indicate the position of the cursor after the insertion of the template output in the active window.
The two example tempate installed with AutoCodeSmith can be used like that
For the property template
Username String p <ctrl-enter>
For the region template
Properties r <ctrl-enter>
Please give me your feedback and if you find bugs, let me know.
I hope it's clear enough and my english is not too bad.
Luc
2005-06-09- New version: 1.5
1. AutoCodeSmith settings form redesign
2. Default template values
3. Parameters reorder
4. CodeSmith 3.0 compatible
2005-06-10- New version: 1.5.1
1. No output problem fixed
2005-06-21 - New version: 1.5.2
Fixed a bug: Alias not correctly update in AutoCodeSmith Settings form when it change.
Fixed a bug: Settings form close when up or down arrow in Parameters Order is click with no selected parmeters
Improvement: In Settings form, remove command button is only available if a command is selected
2005-07-01 New Version 1.5.3
Fixed a bug: Unable to give a string with space. Surround the string with double quote Ex: "Foo bar".
Improvement: Add docking capability to the Settings form
2005-07-29 Version 1.5.4
Improvement: Output is indented properly according to the indentation level of the the command string