private void OnCancelPressed(object sender, CancelEventArgs e)
{
CheckDisposed();
Debug.Assert(!m_ctrl.InvokeRequired);
try
{
// pause the import thread, while we ask if they really want to cancel
m_importer.Pause();
if (m_importer.PrevBook != null)
{
string sMsg = string.Format(TeResourceHelper.GetResourceString("kstidConfirmStopImport"),
m_importer.PrevBook);
if (MessageBox.Show(sMsg, FwUtils.ksTeAppName,
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
// the user does not wish to cancel the import, so cancel the event
e.Cancel = true;
return;
}
}
//Display "stopping" message in progress bar
m_progressDialog.Message = TeResourceHelper.GetResourceString("kstidStoppingImport");
m_progressDialog.Position = m_progressDialog.Maximum;
}
finally
{
// resume the import thread
m_importer.Resume();
}
}
#endregion