Add a simple error catcher for most file loads.

This commit is contained in:
Tim Young 2017-07-31 16:23:38 -05:00
parent b7b5525413
commit 857c8750ba

View File

@ -1672,13 +1672,16 @@ namespace EduNetworkBuilder
//If it is a network file
string extension = Path.GetExtension(filename).ToLower();
//MessageBox.Show(filename + " " +extension);
try
{
if (extension == ".enbx")
{
PrepForLoad();
myNetwork.Load(filename);
UpdateMenu();
UpdateForm();
} else if(extension == ".enbu")
}
else if (extension == ".enbu")
{
CurrentUser = new PersonClass(filename);
OurSettings = NB.GetSettings(); //Grab the new settings from the user
@ -1697,6 +1700,11 @@ namespace EduNetworkBuilder
}
if (OurSettings != null) OurSettings.RegisterFileAsLoaded(filename);
}
catch (Exception e)
{
MessageBox.Show("Error: " + e.ToString());
}
}
private void loadRecentFilename(object sender, EventArgs e)
{