public bool OnFileImportOXESA(object args)
{
CheckDisposed();
using (TeImportExportFileDialog dlg = new TeImportExportFileDialog(m_cache.ProjectId.Name, FileType.OXESA))
{
if (dlg.ShowOpenDialog(null, this) == DialogResult.OK)
{
string sUndo, sRedo;
TeResourceHelper.MakeUndoRedoLabels("kstidImportAnnotations", out sUndo, out sRedo);
using (UndoTaskHelper undoHelper = new UndoTaskHelper(Cache.ActionHandlerAccessor,
null, sUndo, sRedo))
{
using (WaitCursor waitCursor = new WaitCursor(this))
{
Exception e;
XmlScrAnnotationsList.LoadFromFile(dlg.FileName, m_cache, m_StyleSheet, out e);
if (e != null)
{
// Something went wrong while importing so let the user know.
MessageBox.Show(string.Format(Properties.Resources.kstidOxesaImportFailedMsg, e.Message),
Properties.Resources.kstidOxesaImportFailedTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
undoHelper.RollBack = false;
}
}
}
}
return true;
}