public async void OpenProject(string filePath) { try { //restore cursor MainWindow.SetCursor(true); if (AppModel.Project.Count > 1) { throw new Exception("Close previous project, before open a new one."); } // var existing = new ANNProjectController(ActiveModelChanged); await existing.Initproject(filePath); //add project to appModel m_appModel.Project.Add(existing); existing.IsSelected = true; existing.IsExpanded = true; //restore cursor MainWindow.SetCursor(false); } catch (Exception ex) { //restore cursor MainWindow.SetCursor(false); ReportException(ex); //throw; } }
/// <summary> /// creates new project. The command creates new project file /// and folder where other files will be created. No other file location should exists. /// </summary> /// <returns>currently created experiment</returns> public ANNProjectController NewProject() { try { var filePath = promptToSaveFile(); if (string.IsNullOrEmpty(filePath)) { return(null); } var prj = new ANNProjectController(ActiveModelChanged); Project.NewProjectFile(Path.GetFileNameWithoutExtension(filePath), filePath); prj.Initproject(filePath); return(prj); } catch (Exception) { throw; } }
public void OpenProject(string filePath) { try { if (AppModel.Project.Count > 1) { throw new Exception("Close previous project, before open a new one."); } var existing = new ANNProjectController(ActiveModelChanged); existing.Initproject(filePath); m_appModel.Project.Add(existing); existing.IsSelected = true; existing.IsExpanded = true; } catch (Exception ex) { ReportException(ex); //throw; } }