コード例 #1
0
        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;
            }
        }
コード例 #2
0
 /// <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;
     }
 }
コード例 #3
0
 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;
     }
 }