private void SplashScreenDesignerFrm_Load(object sender, EventArgs e) { txtBoxStatMsg.Text = String.Format(@"App Version {0}. Loading...", ApplicationSettings.ApplicationVersionDisplay); ApplicationArgumentModel appArg = ProjectSession.Instance().ApplicationArgumentModel; if (appArg.IsFileOpenCase) { txtBoxStatMsg.Text = String.Format(@"App Version {0}. Opening project '{1}' ...", ApplicationSettings.ApplicationVersionDisplay, appArg.FileName); } }
protected void NewProjectDialog_Confirm(EventArgs e) { ProjectSession session = null; string error = ""; if ((XTMFRuntime.ProjectController.CreateNewProject(XTMFUser, NewProjectName, out session, ref error))) { Projects.Add(session.Project); Console.WriteLine("Adding project"); this.newProjectDialog.Hide(); } else { this.newProjectDialog.Hide(); Console.WriteLine("Error occured"); } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ApplicationArgumentModel applicationArgumentModel = new ApplicationArgumentModel(args); ProjectSession.Instance().ApplicationArgumentModel = applicationArgumentModel; if (applicationArgumentModel.IsOpenProjectBatchFile) { Application.Run(new OneClickProcessorFrm()); } else { SplashScreenDesignerFrm.GetIntance().Show(); Application.Run(new ZipDesigner()); } }
internal static bool Load(ProjectSession session, ModelSystemHeader modelSystemHeader, out ModelSystemSession?msSession, out CommandError?error) { // the parameters are have already been vetted var path = modelSystemHeader.ModelSystemPath; var info = new FileInfo(path); string?errorString = null; error = null; try { ModelSystem?ms; if (info.Exists) { using var rawStream = File.OpenRead(modelSystemHeader.ModelSystemPath); ms = Load(rawStream, session.GetModuleRepository(), modelSystemHeader, ref errorString); } else { ms = new ModelSystem(modelSystemHeader); } if (ms == null) { msSession = null; // Give a generic error message if one was not already supplied. error = new CommandError(errorString ?? "Unable to create a model system session for the given header."); return(false); } msSession = new ModelSystemSession(session, ms); error = null; return(true); } catch (IOException e) { error = new CommandError(e.Message); msSession = null; return(false); } }
public OneClickProcessorFrm() { InitializeComponent(); projectSession = ProjectSession.Instance(); applicationArgumentModel = projectSession.ApplicationArgumentModel; }