private void translationConfig_Click(object sender, EventArgs e) { using (var frm = new FormChooseTranslation()) { frm.ShowDialog(this); // will set Settings.Translation } _settingsPageHost.LoadAll(); Translate(); SaveAndRescan_Click(null, null); }
private static void RunApplication() { string[] args = Environment.GetCommandLineArgs(); // This form created to obtain UI synchronization context only using (new Form()) { // Store the shared JoinableTaskContext ThreadHelper.JoinableTaskContext = new JoinableTaskContext(); } AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); FormFixHome.CheckHomePath(); } if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { // Ensure we can find the git command to execute, // unless we are being instructed to uninstall, // or AppSettings.CheckSettings is set to false. if (!(args.Length >= 2 && args[1] == "uninstall")) { if (!CheckSettingsLogic.SolveGitCommand()) { if (!LocateMissingGit()) { Environment.Exit(-1); return; } } if (AppSettings.CheckSettings) { var uiCommands = new GitUICommands(""); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); var fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } } catch { // TODO: remove catch-all } if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } var commands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { commands.StartBrowseDialog(); } else { // if we are here args.Length > 1 commands.RunCommand(args); } AppSettings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!EnvUtils.IsMonoRuntime()) { try { NBug.Settings.UIMode = NBug.Enums.UIMode.Full; // Uncomment the following after testing to see that NBug is working as configured NBug.Settings.ReleaseMode = true; NBug.Settings.ExitApplicationImmediately = false; NBug.Settings.WriteLogToDisk = false; NBug.Settings.MaxQueuedReports = 10; NBug.Settings.StopReportingAfter = 90; NBug.Settings.SleepBeforeSend = 30; NBug.Settings.StoragePath = NBug.Enums.StoragePath.WindowsTemp; AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; Application.ThreadException += NBug.Handler.ThreadException; } catch (TypeInitializationException tie) { // is this exception caused by the configuration? if (tie.InnerException != null && tie.InnerException.GetType() .IsSubclassOf(typeof(System.Configuration.ConfigurationException))) { HandleConfigurationException((System.Configuration.ConfigurationException)tie.InnerException); } } } string[] args = Environment.GetCommandLineArgs(); FormSplash.ShowSplash(); //Store here SynchronizationContext.Current, because later sometimes it can be null //see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; AsyncLoader.DefaultContinuationTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); Application.DoEvents(); AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (!(args.Length >= 2 && args[1].Equals("uninstall")) && (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue) || !File.Exists(AppSettings.GitCommandValue))) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); ISettingsPageHost fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } catch { // TODO: remove catch-all } FormSplash.HideSplash(); if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } GitUICommands uCommands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { uCommands.StartBrowseDialog(); } else // if we are here args.Length > 1 { uCommands.RunCommand(args); } AppSettings.SaveSettings(); }
private static void RunApplication() { string[] args = Environment.GetCommandLineArgs(); // This form created for obtain UI synchronization context only using (new Form()) { // Store here SynchronizationContext.Current, because later sometimes it can be null // see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; AsyncLoader.DefaultContinuationTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); } AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); FormFixHome.CheckHomePath(); } if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (!(args.Length >= 2 && args[1].Equals("uninstall")) && (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue) || !File.Exists(AppSettings.GitCommandValue))) { GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); ISettingsPageHost fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } catch { // TODO: remove catch-all } if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } GitUICommands commands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { commands.StartBrowseDialog(); } else { // if we are here args.Length > 1 commands.RunCommand(args); } AppSettings.SaveSettings(); }
private static void RunApplication() { string[] args = Environment.GetCommandLineArgs(); // This form created to obtain UI synchronization context only using (new Form()) { // Store the shared JoinableTaskContext ThreadHelper.JoinableTaskContext = new JoinableTaskContext(); } AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); FormFixHome.CheckHomePath(); } if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } if (!AppSettings.TelemetryEnabled.HasValue) { AppSettings.TelemetryEnabled = MessageBox.Show(null, Strings.TelemetryPermissionMessage, Strings.TelemetryPermissionCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes; } try { // Ensure we can find the git command to execute, // unless we are being instructed to uninstall, // or AppSettings.CheckSettings is set to false. if (!(args.Length >= 2 && args[1] == "uninstall")) { if (!CheckSettingsLogic.SolveGitCommand()) { if (!LocateMissingGit()) { Environment.Exit(-1); return; } } if (AppSettings.CheckSettings) { var uiCommands = new GitUICommands(""); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); var fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } } catch { // TODO: remove catch-all } if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } var commands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { commands.StartBrowseDialog(); } else { // if we are here args.Length > 1 // Avoid replacing the ExitCode eventually set while parsing arguments, // i.e. assume -1 and afterwards, only set it to 0 if no error is indicated. Environment.ExitCode = -1; if (commands.RunCommand(args)) { Environment.ExitCode = 0; } } AppSettings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!EnvUtils.IsMonoRuntime()) { try { NBug.Settings.UIMode = NBug.Enums.UIMode.Full; // Uncomment the following after testing to see that NBug is working as configured NBug.Settings.ReleaseMode = true; NBug.Settings.ExitApplicationImmediately = false; NBug.Settings.WriteLogToDisk = false; NBug.Settings.MaxQueuedReports = 10; NBug.Settings.StopReportingAfter = 90; NBug.Settings.SleepBeforeSend = 30; NBug.Settings.StoragePath = NBug.Enums.StoragePath.WindowsTemp; AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; Application.ThreadException += NBug.Handler.ThreadException; } catch (TypeInitializationException tie) { // is this exception caused by the configuration? if (tie.InnerException != null && tie.InnerException.GetType() .IsSubclassOf(typeof(System.Configuration.ConfigurationException))) { HandleConfigurationException((System.Configuration.ConfigurationException)tie.InnerException); } } } string[] args = Environment.GetCommandLineArgs(); FormSplash.ShowSplash(); //Store here SynchronizationContext.Current, because later sometimes it can be null //see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; Application.DoEvents(); AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue)) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); ISettingsPageHost fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create<ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { checkSettingsLogic.AutoSolveAllSettings(); uiCommands.StartSettingsDialog(); } } } } catch { // TODO: remove catch-all } FormSplash.HideSplash(); if (EnvUtils.RunningOnWindows()) MouseWheelRedirector.Active = true; GitUICommands uCommands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { uCommands.StartBrowseDialog(); } else // if we are here args.Length > 1 { uCommands.RunCommand(args); } AppSettings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!EnvUtils.IsMonoRuntime()) { NBug.Settings.UIMode = NBug.Enums.UIMode.Full; // Uncomment the following after testing to see that NBug is working as configured NBug.Settings.ReleaseMode = true; NBug.Settings.ExitApplicationImmediately = false; NBug.Settings.WriteLogToDisk = true; NBug.Settings.MaxQueuedReports = 10; NBug.Settings.StopReportingAfter = 90; NBug.Settings.SleepBeforeSend = 30; NBug.Settings.StoragePath = "WindowsTemp"; AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; Application.ThreadException += NBug.Handler.ThreadException; } string[] args = Environment.GetCommandLineArgs(); FormSplash.ShowSplash(); //Store here SynchronizationContext.Current, because later sometimes it can be null //see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; Application.DoEvents(); Settings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); if (string.IsNullOrEmpty(Settings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (Application.UserAppDataRegistry == null || Settings.GetBool("checksettings", true) || string.IsNullOrEmpty(Settings.GitCommand)) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic, uiCommands.Module); using (var checklistSettingsPage = new ChecklistSettingsPage(commonLogic, checkSettingsLogic, uiCommands.Module, null)) { if (!checklistSettingsPage.CheckSettings()) { checkSettingsLogic.AutoSolveAllSettings(); uiCommands.StartSettingsDialog(); } } } } catch { // TODO: remove catch-all } FormSplash.HideSplash(); if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } GitUICommands uCommands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { uCommands.StartBrowseDialog(); } else // if we are here args.Length > 1 { uCommands.RunCommand(args); } Settings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string[] args = Environment.GetCommandLineArgs(); FormSplash.ShowSplash(); Application.DoEvents(); Settings.LoadSettings(); if (Settings.RunningOnWindows()) { //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); PluginLoader.LoadAsync(); if (string.IsNullOrEmpty(Settings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (Application.UserAppDataRegistry == null || Settings.GetValue <string>("checksettings", null) == null || !Settings.GetValue <string>("checksettings", null).ToString().Equals("false", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(Settings.GitCommand)) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); using (var settings = new FormSettings()) { if (!settings.CheckSettings()) { FormSettings.AutoSolveAllSettings(); GitUICommands.Instance.StartSettingsDialog(); } } } } catch { // TODO: remove catch-all } if (args.Length >= 3) { if (Directory.Exists(args[2])) { Settings.WorkingDir = args[2]; } if (string.IsNullOrEmpty(Settings.WorkingDir)) { if (args[2].Contains(Settings.PathSeparator.ToString())) { Settings.WorkingDir = args[2].Substring(0, args[2].LastIndexOf(Settings.PathSeparator)); } } //Do not add this working dir to the recent repositories. It is a nice feature, but it //also increases the startup time //if (Settings.Module.ValidWorkingDir()) // Repositories.RepositoryHistory.AddMostRecentRepository(Settings.WorkingDir); } if (args.Length <= 1 && string.IsNullOrEmpty(Settings.WorkingDir) && Settings.StartWithRecentWorkingDir) { if (GitModule.ValidWorkingDir(Settings.RecentWorkingDir)) { Settings.WorkingDir = Settings.RecentWorkingDir; } } if (string.IsNullOrEmpty(Settings.WorkingDir)) { string findWorkingDir = GitModule.FindGitWorkingDir(Directory.GetCurrentDirectory()); if (GitModule.ValidWorkingDir(findWorkingDir)) { Settings.WorkingDir = findWorkingDir; } } FormSplash.HideSplash(); if (Settings.RunningOnWindows()) { MouseWheelRedirector.Active = true; } if (args.Length <= 1) { GitUICommands.Instance.StartBrowseDialog(); } else // if we are here args.Length > 1 { RunCommand(args); } Settings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (Settings.RunningOnWindows()) { NBug.Settings.UIMode = NBug.Enums.UIMode.Full; // Uncomment the following after testing to see that NBug is working as configured NBug.Settings.ReleaseMode = true; NBug.Settings.ExitApplicationImmediately = false; NBug.Settings.WriteLogToDisk = true; NBug.Settings.MaxQueuedReports = 10; NBug.Settings.StopReportingAfter = 90; NBug.Settings.SleepBeforeSend = 30; NBug.Settings.StoragePath = "WindowsTemp"; AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; Application.ThreadException += NBug.Handler.ThreadException; } string[] args = Environment.GetCommandLineArgs(); FormSplash.ShowSplash(); //Store here SynchronizationContext.Current, because later sometimes it can be null //see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; Application.DoEvents(); Settings.LoadSettings(); if (Settings.RunningOnWindows()) { //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); if (string.IsNullOrEmpty(Settings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (Application.UserAppDataRegistry == null || Settings.GetValue<string>("checksettings", null) == null || !Settings.GetValue<string>("checksettings", null).Equals("false", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(Settings.GitCommand)) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic, uiCommands.Module); using (var checklistSettingsPage = new ChecklistSettingsPage(commonLogic, checkSettingsLogic, uiCommands.Module, null)) { if (!checklistSettingsPage.CheckSettings()) { checkSettingsLogic.AutoSolveAllSettings(); uiCommands.StartSettingsDialog(); } } } } catch { // TODO: remove catch-all } FormSplash.HideSplash(); if (Settings.RunningOnWindows()) MouseWheelRedirector.Active = true; GitUICommands uCommands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { uCommands.StartBrowseDialog(); } else // if we are here args.Length > 1 { uCommands.RunCommand(args); } Settings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string[] args = Environment.GetCommandLineArgs(); FormSplash.Show("Load settings"); Settings.LoadSettings(); if (Settings.RunningOnWindows()) { //Quick HOME check: FormSplash.SetAction("Check home path"); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Load plugins"); PluginLoader.LoadAsync(); if (string.IsNullOrEmpty(Settings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (Application.UserAppDataRegistry == null || Application.UserAppDataRegistry.GetValue("checksettings") == null || !Application.UserAppDataRegistry.GetValue("checksettings").ToString().Equals("false", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(Settings.GitCommand)) { FormSplash.SetAction("Check settings"); using (var settings = new FormSettings()) { if (!settings.CheckSettings()) { FormSettings.AutoSolveAllSettings(); GitUICommands.Instance.StartSettingsDialog(); } } } } catch { // TODO: remove catch-all } if (args.Length >= 3) { if (Directory.Exists(args[2])) { Settings.WorkingDir = args[2]; } if (string.IsNullOrEmpty(Settings.WorkingDir)) { if (args[2].Contains(Settings.PathSeparator.ToString())) { Settings.WorkingDir = args[2].Substring(0, args[2].LastIndexOf(Settings.PathSeparator)); } } if (Settings.ValidWorkingDir()) { Repositories.RepositoryHistory.AddMostRecentRepository(Settings.WorkingDir); } } if (string.IsNullOrEmpty(Settings.WorkingDir)) { string findWorkingDir = GitCommandHelpers.FindGitWorkingDir(Directory.GetCurrentDirectory()); if (Settings.ValidWorkingDir(findWorkingDir)) { Settings.WorkingDir = findWorkingDir; } } FormSplash.Hide(); if (args.Length <= 1) { GitUICommands.Instance.StartBrowseDialog(); } else // if we are here args.Length > 1 { RunCommand(args); } Settings.SaveSettings(); }
private static void RunApplication() { string[] args = Environment.GetCommandLineArgs(); // This form created for obtain UI synchronization context only using (new Form()) { // Store the shared JoinableTaskContext ThreadHelper.JoinableTaskContext = new JoinableTaskContext(); } AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); FormFixHome.CheckHomePath(); } if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (!(args.Length >= 2 && args[1] == "uninstall") && (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue) || !File.Exists(AppSettings.GitCommandValue))) { GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); ISettingsPageHost fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } catch { // TODO: remove catch-all } if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } GitUICommands commands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { commands.StartBrowseDialog(startWithDashboard: !AppSettings.StartWithRecentWorkingDir); } else { // if we are here args.Length > 1 commands.RunCommand(args); } AppSettings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (Settings.RunningOnWindows()) { NBug.Settings.UIMode = NBug.Enums.UIMode.Full; // Uncomment the following after testing to see that NBug is working as configured NBug.Settings.ReleaseMode = true; NBug.Settings.ExitApplicationImmediately = false; NBug.Settings.WriteLogToDisk = true; NBug.Settings.MaxQueuedReports = 10; AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; Application.ThreadException += NBug.Handler.ThreadException; } string[] args = Environment.GetCommandLineArgs(); FormSplash.ShowSplash(); Application.DoEvents(); Settings.LoadSettings(); if (Settings.RunningOnWindows()) { //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); if (string.IsNullOrEmpty(Settings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (Application.UserAppDataRegistry == null || Settings.GetValue <string>("checksettings", null) == null || !Settings.GetValue <string>("checksettings", null).Equals("false", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(Settings.GitCommand)) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); GitUICommands uiCommands = new GitUICommands(string.Empty); using (var settings = new FormSettings(uiCommands)) { if (!settings.CheckSettings()) { settings.AutoSolveAllSettings(); uiCommands.StartSettingsDialog(); } } } } catch { // TODO: remove catch-all } FormSplash.HideSplash(); if (Settings.RunningOnWindows()) { MouseWheelRedirector.Active = true; } GitUICommands uCommands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { uCommands.StartBrowseDialog(); } else // if we are here args.Length > 1 { uCommands.RunCommand(args); } Settings.SaveSettings(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string[] args = Environment.GetCommandLineArgs(); // FormSplash.ShowSplash(); //Store here SynchronizationContext.Current, because later sometimes it can be null //see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; Application.DoEvents(); AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue)) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); ISettingsPageHost fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create<ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { checkSettingsLogic.AutoSolveAllSettings(); uiCommands.StartSettingsDialog(); } } } } catch { // TODO: remove catch-all } FormSplash.HideSplash(); if (EnvUtils.RunningOnWindows()) MouseWheelRedirector.Active = true; GitUICommands uCommands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { // origin: uCommands.StartBrowseDialog(); // commit UI: (for gitcom.exe) var exe = Assembly.GetExecutingAssembly(); uCommands.RunCommand(new string[] {exe.Location, "commit" }); } else // if we are here args.Length > 1 { uCommands.RunCommand(args); } AppSettings.SaveSettings(); }