private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { MainForm.UpdateStatusLabelCallback d = new MainForm.UpdateStatusLabelCallback(mainFormRef.UpdateStatusLabel); if (e.Error != null) { Invoke(d, Color.DarkRed, "ОШИБКА! " + e.Error.Message); } Invoke(d, Color.Black, ""); }
//private void SetPressureDrill() //{ // MainForm.UpdateStatusLabelCallback d = new MainForm.UpdateStatusLabelCallback(mainFormRef.UpdateStatusLabel); // try // { // MainForm.CurrentDPI.SetPressure((double)nudSetpoint.Value, MainForm.progState.PIsAbsolute); // Invoke(d, Color.Black, ""); // } // catch (ThreadAbortException) // { // Invoke(d, Color.Black, ""); // return; // } // catch (Exception exp) // { // Invoke(d, Color.DarkRed, "ОШИБКА! " + exp.Message); // } //} //private void DropPressureDrill() //{ // ChangeButtonStatesCallback dbtns = new ChangeButtonStatesCallback(ChangeButtonStates); // MainForm.UpdateStatusLabelCallback d = new MainForm.UpdateStatusLabelCallback(mainFormRef.UpdateStatusLabel); // try // { // MainForm.CurrentDPI.Ventilate(); // Invoke(d, Color.Black, ""); // } // catch (Exception exp) // { // Invoke(d, Color.DarkRed, "ОШИБКА! " + exp.Message); // } // finally // { // Invoke(dbtns, true, true); // } //} private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; if (worker.CancellationPending == true) { e.Cancel = true; return; } MainForm.UpdateStatusLabelCallback d = new MainForm.UpdateStatusLabelCallback(mainFormRef.UpdateStatusLabel); Invoke(d, Color.Black, ""); }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ChangeButtonStatesCallback dbtns = new ChangeButtonStatesCallback(ChangeButtonStates); MainForm.UpdateStatusLabelCallback d = new MainForm.UpdateStatusLabelCallback(mainFormRef.UpdateStatusLabel); MainForm.CurrentDPI.Ventilate(); if (e.Error != null) { Invoke(d, Color.DarkRed, "ОШИБКА! " + e.Error.Message); } else { Invoke(d, Color.Black, ""); } Invoke(dbtns, true, true); }
private void SetPressureDrill() { MainForm.UpdateStatusLabelCallback d = new MainForm.UpdateStatusLabelCallback(mainFormRef.UpdateStatusLabel); try { MainForm.CurrentDPI.SetPressure(pPoints[currentPtIndex], MainForm.progState.PIsAbsolute); Invoke(d, Color.Black, ""); } catch (ThreadAbortException) { Invoke(d, Color.Black, ""); return; } catch (Exception exp) { Invoke(d, Color.DarkRed, "ОШИБКА! " + exp.Message); } }
private void DropPressureDrill() { ChangeButtonStatesCallback dbtns = new ChangeButtonStatesCallback(ChangeButtonStates); MainForm.UpdateStatusLabelCallback d = new MainForm.UpdateStatusLabelCallback(mainFormRef.UpdateStatusLabel); try { MainForm.CurrentDPI.Ventilate(); Invoke(d, Color.Black, ""); } catch (Exception exp) { Invoke(d, Color.DarkRed, "ОШИБКА! " + exp.Message); } finally { Invoke(dbtns, true, true, true, true); } }