private void btnImportRawData_Click(object sender, EventArgs e) { if (backgroundWorker1.IsBusy != true) { // create a new instance of the alert form progressDlg = new frmProgress(); progressDlg.StartPosition = FormStartPosition.CenterParent; // event handler for the Cancel button in AlertForm progressDlg.Canceled += new EventHandler <EventArgs>(buttonCancel_Click); progressDlg.Show(this); // Start the asynchronous operation. backgroundWorker1.RunWorkerAsync(); } }
private void DumpTableToCsv(SQLiteConnection conn, string tblName) { if (backgroundWorker2.IsBusy != true) { // create a new instance of the alert form progressDlg = new frmProgress(); progressDlg.StartPosition = FormStartPosition.CenterParent; // event handler for the Cancel button in AlertForm progressDlg.Canceled += new EventHandler <EventArgs>(buttonCancel_Click); progressDlg.Show(this); // Start the asynchronous operation. backgroundWorker2.RunWorkerAsync(); } }