示例#1
0
        private static void Main(string[] args)
        {
            CrashHandler.CreateGlobalErrorHandler();
            UpdateSettings();

            // Set the user interface language
            UILanguage language = UILanguage.CreateUILanguage(Settings.Default.UILanguage);

            if (language != null)
            {
                Strings.Culture = language.Culture;
            }

            // Some GUI settings
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ToolStripManager.VisualStylesEnabled = false;

            // Launch the application
            LoadFiles(args);
            Application.Run(new MainForm());

            // Save application settings
            DiagramEditor.Settings.Default.Save();
            Settings.Default.Save();
        }
示例#2
0
        private void LoadSettings()
        {
            // General settings
            cboLanguage.SelectedItem        = UILanguage.CreateUILanguage(Settings.Default.UILanguage);
            chkRememberOpenProjects.Checked = Settings.Default.RememberOpenProjects;

            // Diagram settings
            chkUsePrecisionSnapping.Checked = DiagramEditor.Settings.Default.UsePrecisionSnapping;
            if (DiagramEditor.Settings.Default.ShowChevron == ChevronMode.Always)
            {
                radChevronAlways.Checked = true;
            }
            else if (DiagramEditor.Settings.Default.ShowChevron == ChevronMode.AsNeeded)
            {
                radChevronAsNeeded.Checked = true;
            }
            else
            {
                radChevronNever.Checked = true;
            }

            if (DiagramEditor.Settings.Default.UseClearType == ClearTypeMode.Always)
            {
                radClearTypeAlways.Checked = true;
            }
            else if (DiagramEditor.Settings.Default.UseClearType == ClearTypeMode.WhenZoomed)
            {
                radClearTypeWhenZoomed.Checked = true;
            }
            else
            {
                radClearTypeNever.Checked = true;
            }
            chkClearTypeForImages.Checked = DiagramEditor.Settings.Default.UseClearTypeForImages;

            // Style settings
            savedStyle = (Style)Style.CurrentStyle.Clone();
            stylePropertyGrid.SelectedObject = Style.CurrentStyle;
        }
示例#3
0
        private static void Main(string[] args)
        {
            // Run program with logger
            App           app = new App();
            string        result;
            List <string> projectFiles = new List <string>();

            for (int i = 0; i < args.Length; i++)
            {
                switch (args[i])
                {
                case "-projects":
                case "-p":
                    result = App.FileExist(i, args.Length, args[i + 1], "-projects");
                    if (string.IsNullOrWhiteSpace(result) == false)
                    {
                        return;
                    }

                    // Do we have other project behind the fist one
                    for (int j = i + 2; j < args.Length; j++)
                    {
                        // If another arg is present
                        if (args[j].StartsWith("-") == true)
                        {
                            break;
                        }

                        result = App.FileExist(j, args.Length, args[j], "-projects");

                        if (string.IsNullOrWhiteSpace(result) == false)
                        {
                            continue;
                        }

                        projectFiles.Add(args[j]);
                    }
                    break;

                case "-log_cfg":
                case "-l":
                    app.ArgumentLog(i, args.Length, args[i + 1]);
                    break;
                }
            }

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomainOnUnhandledException);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(ApplicationThreadException);

            app.Start();
            UpdateSettings();

            // Set the user interface language
            UILanguage language = UILanguage.CreateUILanguage(Settings.Default.UILanguage);

            if (language != null)
            {
                Strings.Culture = language.Culture;
            }

            // Some GUI settings
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.DoEvents();
            ToolStripManager.VisualStylesEnabled = false;

            // Launch the application
            LoadProjects(projectFiles.ToArray());
            Application.Run(new MainForm());

            // Save application settings
            DiagramEditor.Settings.Default.Save();
            Settings.Default.Save();
        }