Inheritance: System.Windows.Forms.Form, IConfigurationView
Beispiel #1
0
        internal static void Main()
        {
            try {
                if (!IsSingleInstance())
                {
                    MessageBox.Show("You cannot run several instances of Settings Tool. The application will be terminated.", "Warning",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

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

                ConfigureLogger();

                IConfigurationController controller = new ConfigurationFormController(Facade.Instance, UIFactory.Instance);
                var view = new ConfigurationForm();
                controller.RegisterView(view);
                controller.PrepareView();

                // TODO move try/catch with AssemblyLoadException here
                Application.Run(view);
            } finally {
                CloseMutex();
            }
        }
        internal static void Main() {
            try {
                if(!IsSingleInstance()) {
                    MessageBox.Show("You cannot run several instances of Settings Tool. The application will be terminated.", "Warning",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

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

                ConfigureLogger();

                IConfigurationController controller = new ConfigurationFormController(Facade.Instance, UIFactory.Instance);
                var view = new ConfigurationForm();
                controller.RegisterView(view);
                controller.PrepareView();

                // TODO move try/catch with AssemblyLoadException here
                Application.Run(view);
            } finally {
                CloseMutex();
            }
        }