private void openProject(ref LMSProject project, bool isRetrieveHierarchy, DataMethod clearProjectControls, DataMethod associateProjectData, TextBox textBoxPath) { clearStatus(); OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "LMS Test.Lab 15A Project (*.lms)|*.lms"; openFileDialog.FilterIndex = 1; openFileDialog.RestoreDirectory = true; DialogResult dialogResult = openFileDialog.ShowDialog(); if (dialogResult == DialogResult.OK) { string filePath = openFileDialog.FileName; project = new LMSProject(filePath, isRetrieveHierarchy); clearProjectControls(); textBoxPath.Text = filePath; associateProjectData(); setStatus("The project was successfully opened"); } else if (dialogResult != DialogResult.Cancel) { setStatus("An error occured while choosing a project file"); return; } else { return; } }
private void testOpenProject() { string filePath = Path.GetFullPath(@"..\..\examples\VSTAB.lms"); project_ = new LMSProject(filePath); clearCurrentProjectControls(); textBoxProjectPath.Text = filePath; associateCurrentProjectData(); }
// Add distortions to combobox void fillDistortionCombobox(LMSProject project, ComboBox combobox) { List <string> distortions = project.findDistortions(); combobox.Items.Clear(); foreach (string tString in distortions) { combobox.Items.Add(tString); } }