Пример #1
0
        static int Main(string[] args)
        {
            ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ProjectSettings     projectSettings;
            SubversionArguments subversionArguments;

            if (args.Length == 0)
            {
                var projectSettingsWindow = new ProjectSettingsWindow();
                if (projectSettingsWindow.ShowDialog() == DialogResult.OK)
                {
                    projectSettings     = projectSettingsWindow.ProjectSettings;
                    subversionArguments = projectSettingsWindow.SubversionArguments;
                }
                else
                {
                    return(1);
                }
            }
            else
            {
                try
                {
                    if (args[0].Trim().ToLowerInvariant() == "-r")
                    {
                        subversionArguments = ReadCommandLineArguments(args);
                    }
                    else if (args.Length == 6)
                    {
                        subversionArguments = ReadTortoiseArguments(args);

                        if (!String.IsNullOrEmpty(subversionArguments.Error))
                        {
                            Console.Error.WriteLine("Subversion error:");
                            Console.Error.WriteLine(subversionArguments.Error);
                            return(1);
                        }
                    }
                    else
                    {
                        ShowHelp();
                        return(1);
                    }

                    if (subversionArguments == null)
                    {
                        return(1);
                    }

                    projectSettings = LoadProjectSettings(subversionArguments);
                }
                catch (Exception)
                {
                    return(1);
                }
            }

            try
            {
                var form = new GollumForm(projectSettings, subversionArguments);
                Application.Run(form);
            }
            catch (Exception e)
            {
                // The error printed here shows up in the tortoiseSVN commit window.
                Console.Error.WriteLine(e.Message);
                Console.Error.WriteLine("Stack trace:");
                Console.Error.WriteLine(e.StackTrace);
                return(1);
            }

            return(0);
        }
 private void ShowProjectSettings()
 {
     var projectSettings       = this.ServiceProvider.GetRequiredService <IProjectSettings>() as ProjectSettingsEx;
     var projectSettingsWindow = new ProjectSettingsWindow(projectSettings, this.ServiceProvider);
     var result = projectSettingsWindow.ShowDialog();
 }