public static Project TryCreateFromCommandLine(AppView app) { var docPath = _AppConstants.StartupOpenDocumentPath; if (!docPath.HasValue) { return(null); } var prj = ProjectDOM.LoadProjectFrom(docPath.Value); var prjv = Project.Create(app, prj, docPath.Value); // var outDir = args.FirstOrDefault(item => item.StartsWith("-OutDir:")); // if (outDir != null) outDir = outDir.Substring(8).Trim('"'); // prjv.TargetDirectory = outDir; return(prjv); }
public static Project OpenFile(AppView app, PathString filePath) { if (app == null) { return(null); } if (!filePath.FileExists) { return(null); } try { var prj = ProjectDOM.LoadProjectFrom(filePath); return(Project.Create(app, prj, filePath)); } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message, "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); return(null); } }