Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The OnInit event fires when the CodeSmith 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.

  • No labels