private void OpenSequenceFromFile(string filename)
{
Cursor.Current = Cursors.WaitCursor;
try {
IEditorUserInterface editor = EditorService.Instance.CreateEditor(filename);
if (editor == null) {
Logging.Error("Can't find an appropriate editor to open file " + filename);
//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
var messageBox = new MessageBoxForm("Can't find an editor to open this file type. (\"" + Path.GetFileName(filename) + "\")",
"Error opening file", false, false);
messageBox.ShowDialog();
}
else {
_OpenEditor(editor);
}
}
catch (Exception ex) {
Logging.Error("Error trying to open file '" + filename + "': ", ex);
//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
var messageBox = new MessageBoxForm("Error trying to open file '" + filename + "'.", "Error opening file", false, false);
messageBox.ShowDialog();
}
}