The Progress Object

The Progress Object

The Progress object lets you show a progress bar to the template user when CodeSmith Generator is rendering the template. This is useful when a template takes a long time to render, as it provides a visual cue to the user that CodeSmith Generator has not ceased responding. If you're using CodeSmith Explorer, the progress bar is displayed to the left of the Generate button:

The Progress Object.png

If you're using Visual Studio, the progress bar is displayed in the status bar, to the left of the line and column indicators:

The Progress Object 2.png

To use the Progress object, you'll typically set the maximum value and the amount of change represented by one progress step:

this.Progress.MaximumValue = 25; this.Progress.Step = 1;

Each time you want to increment the progress indicator on screen, you then call the PerformStep method:

this.Progress.PerformStep();