Allow .enbu files

This commit is contained in:
Tim Young 2017-07-31 19:47:22 -05:00
parent c7c563ce86
commit 86addf875c

View File

@ -1392,14 +1392,18 @@ namespace EduNetworkBuilder
{
OpenFileDialog mydialog = new OpenFileDialog();
mydialog.AddExtension = true;
mydialog.Filter = "EduNet File (*.enbx, *enbu)|*.enbx; *.enbu";
//If we have a user loaded, we can open homework files
string filter = "EduNet File (*.enbx, *enbu)|*.enbx; *.enbu";
if(NB.GetUser() != null)
filter = "EduNet File (*.enbx, *enbu, *enbh)|*.enbx; *.enbu; *.enbh";
mydialog.Filter = filter;
mydialog.Multiselect = false;
mydialog.ShowHelp = true;
if (LastPath != null && LastPath != "") mydialog.FileName = LastPath;
DialogResult result = mydialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel) return;
string extension = Path.GetExtension(mydialog.FileName).ToString();
if(extension != ".enbx" && extension != ".enbu")
if(extension != ".enbx" && extension != ".enbu" && extension != ".enbh")
{
MessageBox.Show(NB.Translate("_LoadErr"));
return;