Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected links that should have been relative instead of absolute.

The OnInit event fires when the CodeSmith engine Generator engine creates an instance of your template. You can override this event to perform any necessary setup tasks for your template. For instance, suppose your template uses an additional TextWriter to send a copy of its output to a socket on a remote computer via the Internet. You could override the OnInit event to check for Internet connectivity, and warn the user that the template will not succeed if you can't find an open Internet connection when the template is instantiated.