Using CodeSmith.CustomProperties
CodeSmith Generator includes CodeSmith.CustomProperties, an assembly of property types and editors for your template properties. It's installed in the AddIns folder of the Generator installation folder, so templates can reference it by name:
<%@ Assembly Name="CodeSmith.CustomProperties" %>
<%@ Import Namespace="CodeSmith.CustomProperties" %>
| Page | What it covers |
|---|---|
| FileNameEditor | Let the user pick a file name with an Open or Save dialog. |
| StringCollection | Let the user enter a list of strings. Obsolete; use List<string> instead. |
For the complete list of editors that ship with Generator, see Adding designer support.
Building your own property types
The CustomPropertiesSample project shows how to build your own property types and editors, such as a drop-down list, a drop-down editor and a modal dialog editor. You'll find it in the samples, in Documents\CodeSmith Generator\Samples\v8.5\Projects\CSharp\CustomPropertiesSample (and a Visual Basic version under Projects\VisualBasic), and on GitHub. For a walkthrough, see Building a custom UITypeEditor.