|
![]() |
Base class for progress related events where event handler can replace standard implementation
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Remarks
This class is the base class for a number of Progress related event arguments:
Examples

Autodesk.Navisworks.Api.Application.ProgressBeginning += new EventHandler<Autodesk.Navisworks.Api.ProgressBeginningEventArgs>(Application_ProgressBeginning); Autodesk.Navisworks.Api.Application.ProgressSubOperationBegan += new EventHandler<Autodesk.Navisworks.Api.ProgressSubOperationBeganEventArgs>(Application_ProgressSubOperationBegan); Autodesk.Navisworks.Api.Application.ProgressUpdating += new EventHandler<Autodesk.Navisworks.Api.ProgressUpdatingEventArgs>(Application_ProgressUpdating); Autodesk.Navisworks.Api.Application.ProgressErrorReporting += new EventHandler<Autodesk.Navisworks.Api.ProgressErrorReportingEventArgs>(Application_ProgressErrorReporting); Autodesk.Navisworks.Api.Application.ProgressMessageReporting += new EventHandler<Autodesk.Navisworks.Api.ProgressMessageReportingEventArgs>(Application_ProgressMessageReporting); Autodesk.Navisworks.Api.Application.ProgressSubOperationEnded += new EventHandler<Autodesk.Navisworks.Api.ProgressSubOperationEndedEventArgs>(Application_ProgressSubOperationEnded); Autodesk.Navisworks.Api.Application.ProgressEnded += new EventHandler<Autodesk.Navisworks.Api.ProgressEndedEventArgs>(Application_ProgressEnded); progressBar.ProgressBar.Maximum = 100; //The following are the declarations for controls in a windows form //private System.Windows.Forms.StatusStrip statusStrip; //private System.Windows.Forms.ToolStripStatusLabel statusText; //private System.Windows.Forms.ToolStripProgressBar progressBar; //private System.Windows.Forms.ToolStripStatusLabel statusSubText; void Application_ProgressBeginning(object sender, Autodesk.Navisworks.Api.ProgressBeginningEventArgs e) { statusText.Text = e.Title; statusSubText.Text = string.Empty; progressBar.Visible = true; e.Handled = true; statusStrip.Refresh(); } void Application_ProgressSubOperationBegan(object sender, Autodesk.Navisworks.Api.ProgressSubOperationBeganEventArgs e) { //Mostly unrequired as other events should give all the information required } void Application_ProgressSubOperationEnded(object sender, Autodesk.Navisworks.Api.ProgressSubOperationEndedEventArgs e) { //Mostly unrequired as other events should give all the information required } void Application_ProgressUpdating(object sender, Autodesk.Navisworks.Api.ProgressUpdatingEventArgs e) { int value = Convert.ToInt32(e.OverallFractionDone * 100.000); if (progressBar.ProgressBar.Value != value) { progressBar.ProgressBar.Value = value; e.Handled = true; statusStrip.Refresh(); } } void Application_ProgressMessageReporting(object sender, Autodesk.Navisworks.Api.ProgressMessageReportingEventArgs e) { if (statusSubText.Text != e.Message) { statusSubText.Text = e.Message; e.Handled = true; statusStrip.Refresh(); } } void Application_ProgressErrorReporting(object sender, Autodesk.Navisworks.Api.ProgressErrorReportingEventArgs e) { if (MessageBox.Show(e.Message, "Error", MessageBoxButtons.OKCancel) != DialogResult.OK) { e.Canceled = true; } e.Handled = true; statusStrip.Refresh(); } void Application_ProgressEnded(object sender, Autodesk.Navisworks.Api.ProgressEndedEventArgs e) { statusText.Text = string.Empty; statusSubText.Text = string.Empty; progressBar.Visible = false; statusStrip.Refresh(); }
Inheritance Hierarchy
System..::..Object
System..::..EventArgs
Autodesk.Navisworks.Api..::..ProgressEventArgs
Autodesk.Navisworks.Api..::..ProgressBeginningEventArgs
Autodesk.Navisworks.Api..::..ProgressErrorReportingEventArgs
Autodesk.Navisworks.Api..::..ProgressMessageReportingEventArgs
Autodesk.Navisworks.Api..::..ProgressUpdatingEventArgs
System..::..EventArgs
Autodesk.Navisworks.Api..::..ProgressEventArgs
Autodesk.Navisworks.Api..::..ProgressBeginningEventArgs
Autodesk.Navisworks.Api..::..ProgressErrorReportingEventArgs
Autodesk.Navisworks.Api..::..ProgressMessageReportingEventArgs
Autodesk.Navisworks.Api..::..ProgressUpdatingEventArgs