The OnPreRender Event

The OnPreRender event is fired just before the CodeSmith Generator engine merges metadata with your template to produce the template's output. One use for this event is to perform "sanity checks" on metadata entered by the user. You could, for example, check that a date entered was within an acceptable range, and change it to the earliest or latest acceptable date if it is not.

Although you can modify metadata in the OnPreRender event, you cannot prevent the template from being rendered.