Versions Compared

Key

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

The key to making templates flexible and useful is to define properties or metadata. CodeSmith uses Generator uses properties to customize the generated code. When the user opens a template in CodeSmith Explorer, they must supply values for all of the required properties defined in the template before they can generate the code. Note that properties can be defined as optional properties, in which case the user need not supply a value before generating code.

...

Code Block
languagevb
' The key is Ham

Properties in CodeSmith can Generator can be simple or very complex. You can define enumerated properties that allow the user to choose from a predefined selection of values. You can use CodeSmithCodeSmith Generator 's SchemaExplorer to fill properties from database objects. You can create properties based on the contents of an XML file, or even define your own custom properties complete with custom dialog boxes for user property editing.