private static void RunOther() { switch (StartupArguments.Run) { case "mcsync": MCSync.Program.Main(StartupArguments.GetArgsForApp("mcsync")); break; } }
private void pboxUserManagement_Click(object sender, EventArgs e) { StartProgram(() => UserManagement.Program.Main(StartupArguments.GetArgsForApp("usermanagement"))); }
static void Main(string[] args) { StartupArguments.SetupArguments(args); if (StartupArguments.UpdaterProcessID != -1) { Console.WriteLine("Waiting for Updater to close..."); while (Process.GetProcesses().Any(p => p.Id == StartupArguments.UpdaterProcessID)) { Thread.Sleep(50); } } if (!string.IsNullOrEmpty(StartupArguments.FolderToDelete) && Directory.Exists(StartupArguments.FolderToDelete)) { Directory.Delete(StartupArguments.FolderToDelete, true); } // Splash screen logic Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); frmSplash splash = new frmSplash(); splash.Show(); Stopwatch shownTime = new Stopwatch(); shownTime.Start(); Application.DoEvents(); Thread initThread = new Thread(new ThreadStart(InitializeApplication)); initThread.Start(); while (initThread.IsAlive) { Thread.Sleep(50); Application.DoEvents(); } while (shownTime.ElapsedMilliseconds < 1000) { Thread.Sleep(50); } shownTime.Stop(); splash.Close(); if (updates == null) { MessageBox.Show("An error occurred while retrieving updates. MesaSuite may not start without checking for updates.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (updates.Any()) { frmUpdate update = new frmUpdate(); update.UpdaterResults = updates; Application.Run(update); return; } if (!string.IsNullOrEmpty(StartupArguments.Run)) { RunOther(); } else { Application.Run(new frmMain()); } }
private void StartMCSync() { MCSync.Program.Main(StartupArguments.GetArgsForApp("mcsync")); }