public void CloseForm() { _pg_form.Close(); ProgressInfoForm.Instance.Dispose(); ProgressInfoForm.Instance = null; _pg_form = null; }
public ProgressInfoMng() { if (MainBaseForm.Instance != null) { _singleton = this; Globals.Instance.Cursor = Cursors.WaitCursor; _pg_form = ProgressInfoForm.Instance; _pg_bar = Globals.Instance.ProgressBar; _cursor = Globals.Instance.Cursor; #if TRACE _timer = Library.Timer.Instance; #endif // // BkWorker // this.BkWorker.WorkerReportsProgress = true; this.BkWorker.WorkerSupportsCancellation = true; this.BkWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.BkWorker_DoWork); this.BkWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.BkWorker_RunWorkerCompleted); this.BkWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.BkWorker_ProgressChanged); Init(100, 1); } }
private ProgressInfoForm(Form caller) { this.Tag = Resources.Consts.NO_FORMAT; InitializeComponent(); PictureBox.CheckForIllegalCrossThreadCalls = false; _singleton = this; _caller = caller; // (caller != null) ? caller : MainBaseForm.Instance; }
public void Reset(int max, int step, string status_messsage, string track_message, BaseForm caller) { PGStatus = EStatus.Working; State = BGResult.Working; if (_pg_form == null) { _pg_form = ProgressInfoForm.Instance; } // Formulario que lo invoca _caller = caller; _pg_form.Caller = caller; if (_caller != null) { // Barra de progreso del formulario de progreso _caller.ResetProgressBar(max + step, step); /*_caller.ProgressInfo_PB.Maximum = max + step; * _caller.ProgressInfo_PB.Value = _pg_form.ProgressInfo_PB.Minimum + step; * _caller.ProgressInfo_PB.Step = step;*/ } // Barra de progreso del formulario de progreso _pg_form.ProgressInfo_PB.Maximum = max + step; _pg_form.ProgressInfo_PB.Value = _pg_form.ProgressInfo_PB.Minimum + step; _pg_form.ProgressInfo_PB.Step = step; try { // Barra de progreso de la barra de estado _pg_bar.Maximum = max + step; _pg_bar.Value = _pg_bar.Minimum + step; _pg_bar.Step = step; } catch { } // Mensaje de estado Message = status_messsage; this.Start(track_message); #if TRACE // Timer para depuración _timer.Reset(); #endif }