public void SingleConfigurationProgressHandler(ProgressCallbackEventArgs progressArgs) { if (this.m_FormClosed) { // if form is closed we have no access to controls this.MasterInterpreter.Cancel(); return; } this.progressBarSingle.Value = Math.Min((int)progressArgs.Percent, 100); this.lblSingle.Text = string.Format("{0} - {2}", progressArgs.Context, progressArgs.Configuration, progressArgs.Title); }
public void MultipleConfigurationProgressHandler(ProgressCallbackEventArgs progressArgs) { if (this.m_FormClosed) { // if form is closed we have no access to controls this.MasterInterpreter.Cancel(); return; } this.m_stopwatch.Start(); this.progressBarMultiple.Value = Math.Min((int)progressArgs.Percent, 100); if (progressArgs.Configuration == null) { this.lblMultiple.Text = string.Format("{0} - {1}", progressArgs.Context, progressArgs.Title); } else { this.lblMultiple.Text = string.Format("{0} - [{1}] - {2}", progressArgs.Context, progressArgs.Configuration, progressArgs.Title); } if (progressArgs.Percent == 0) { this.lblTimeEstimate.Text = "Calculating remaining time..."; } else { TimeSpan remaining = new TimeSpan(this.m_stopwatch.Elapsed.Ticks * (long)((100 - progressArgs.Percent) / progressArgs.Percent)); // TODO: make this label more user friendly this.lblTimeEstimate.Text = string.Format("Estimated remaining time: {0}.", remaining.Format()); } if (progressArgs.Percent == 100) { if (this.IsDisposed == false) { this.m_RaiseExceptionOnClose = false; this.m_UserCancelled = false; this.Close(); } } }
public void MultipleConfigurationProgressHandler(object o, ProgressCallbackEventArgs progressArgs) { if (this.m_FormClosed) { // if form is closed we have no access to controls this.MasterInterpreter.Cancel(); return; } this.m_stopwatch.Start(); this.progressBarMultiple.Value = Math.Min((int)progressArgs.Percent, 100); if (progressArgs.Configuration == null) { this.lblMultiple.Text = string.Format("{0} - {1}", progressArgs.Context, progressArgs.Title); } else { this.lblMultiple.Text = string.Format("{0} - [{1}] - {2}", progressArgs.Context, progressArgs.Configuration, progressArgs.Title); } if (progressArgs.Percent == 0) { this.lblTimeEstimate.Text = "Calculating remaining time..."; } else { TimeSpan remaining = new TimeSpan(this.m_stopwatch.Elapsed.Ticks * (long)((100 - progressArgs.Percent) / progressArgs.Percent)); // TODO: make this label more user friendly this.lblTimeEstimate.Text = string.Format("Estimated remaining time: {0}.", remaining.Format()); } if (progressArgs.Percent == 100) { if (this.IsDisposed == false) { this.m_RaiseExceptionOnClose = false; this.m_UserCancelled = false; this.Close(); } } }
protected virtual void OnMultipleConfigurationProgress(ProgressCallbackEventArgs e) { EventHandler<ProgressCallbackEventArgs> handler = this.MultipleConfigurationProgress; if (handler != null) { handler(this, e); } }
public void SingleConfigurationProgressHandler(object o, ProgressCallbackEventArgs progressArgs) { if (this.m_FormClosed) { // if form is closed we have no access to controls this.MasterInterpreter.Cancel(); return; } this.progressBarSingle.Value = Math.Min((int)progressArgs.Percent, 100); this.lblSingle.Text = string.Format("{0} - {2}", progressArgs.Context, progressArgs.Configuration, progressArgs.Title); }