void read_test_file() { if (practice) { try { test = Test.read_XML(Test.test_file(Settings.PracticeTest)); } catch { MessageBox.Show("Couldn't find practice test"); Close(); } } else { try { test = Test.read_XML(Test.test_file(Settings.ActiveTest)); } catch { MessageBox.Show("Couldn't find test file. Please check the /Tests/" + Settings.ActiveTest + "/ folder for a text.xml file."); Close(); } } show_test_description(); }
void load_test_files() { string[] directories; try { directories = Directory.GetDirectories(Settings.testsFolder); } catch (DirectoryNotFoundException) { Directory.CreateDirectory(Settings.testsFolder.TrimEnd(new char[] { '/' })); directories = Directory.GetDirectories(Settings.testsFolder); } foreach (var directory in directories) { availableTests.Add(Test.read_XML(directory + "/test.xml")); //make smarter } }