private void ExcelLoader_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { lock (this) { if (e.Error != null) { m_lblLoading.Visible = false; MessageBox.Show(this, $"The file {m_lblSpreadsheetFilePath.Text} could not be read.", "Invalid Excel Spreadsheet", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (!ExcelSpreadsheetLoader.CancellationPending) { Data = e.Result as ReferenceTextData; } } }
private void ExcelLoader_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { lock (this) { m_lblLoading.Visible = false; if (e.Error != null) { MessageBox.Show(this, $"The file {m_lblSpreadsheetFilePath.Text} could not be read.", "Invalid Excel Spreadsheet", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (!ExcelSpreadsheetLoader.CancellationPending) { Data = e.Result as ReferenceTextData; if (Data == null) { MessageBox.Show(this, $"No error was reported, but no data was loaded from file {m_lblSpreadsheetFilePath.Text}.", "Something bad happened", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } colAction.MinimumWidth = colAction.Width; } } }