public ProgressInterface() { _dlg = null; // create a background thread, and initialize the dlg within in _dlgThread = new System.Threading.Thread( () => { _dlg = new ControlsLibrary.ProgressDialog(); System.Windows.Forms.Application.Run(_dlg); }); _dlgThread.Start(); // stall here waiting for _dlg to become something other than null while (_dlg == null) { System.Threading.Thread.Yield(); } }
internal StepInterface(ProgressDialog dlg, string name, uint progressMax, bool cancellable) { _dlg = dlg; _dlg.Execute( (o) => { _dlg._stepLabel.Text = name; _dlg._bar.Maximum = (int)progressMax; _dlg._bar.Step = 1; _dlg.Cancelled = false; _dlg._cancelBtn.Enabled = cancellable; }); }