/// <summary> /// Utilize the status strip label and progress bar via the status bar /// text provider. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event argumnents</param> private void btnProgress_Click(object sender, EventArgs e) { StatusBarTextProvider.InitializeProgressBar(100); for (int i = 0; i < 100; i++) { StatusBarTextProvider.UpdateProgress(i + 1, String.Format("Step #{0}", i + 1)); System.Threading.Thread.Sleep(25); } StatusBarTextProvider.ResetProgressBar(); }
/// <summary> /// Build the help file using the current project settings /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void miBuildProject_Click(object sender, EventArgs e) { // If it's a new project without a name, ask the // user to save it now. This is required as we need // a base folder for any relative paths in the project. if (project.Filename == SandcastleProject.DefaultName) { miSaveProjectAs_Click(sender, e); if (project.Filename == SandcastleProject.DefaultName) { return; } } this.SetUIEnabledState(false); lastBuiltHelpFile = null; txtOutput.Text = String.Empty; buildProcess = new BuildProcess(project); buildProcess.BuildStepChanged += new EventHandler <BuildProgressEventArgs>( buildProcess_BuildStepChanged); buildProcess.BuildProgress += new EventHandler <BuildProgressEventArgs>( buildProcess_BuildProgress); StatusBarTextProvider.InitializeProgressBar(0, (int)BuildStep.Completed, "Building help file"); buildThread = new Thread(new ThreadStart( buildProcess.Build)); buildThread.Name = "Help file builder thread"; buildThread.IsBackground = true; buildThread.Start(); }