예제 #1
0
        private static void Main()
        {
#if __MonoCS__
            Environment.SetEnvironmentVariable("MONO_WINFORMS_XIM_STYLE", "disabled", EnvironmentVariableTarget.Process);
            //this is because of Bug 436000 - XIM: winforms program crash randomly while starting XIM on Mono
            //see https://bugzilla.novell.com/show_bug.cgi?id=436000
            //https://bugzilla.xamarin.com/show_bug.cgi?id=28047
#endif
            Thread.CurrentThread.CurrentCulture         = Settings.Default.Language ?? new CultureInfo("en");
            Thread.CurrentThread.CurrentUICulture       = Settings.Default.Language ?? new CultureInfo("en");
            Application.ThreadException                += Application_ThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            Application.EnableVisualStyles();
            LoadingScreen.ShowSplashScreen();


            if (!GlobalConfig.IsUnix && Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }

            GSLInitializer.Initialize(new MessagingService());

            Application.SetCompatibleTextRenderingDefault(false);

            if (!GlobalConfig.IsUnix)
            {
                Application.AddMessageFilter(new MyMessageFilter());//TODO: find a way to redirect messages to underlying controls in Unix
            }
            var mainForm = (new WinFormsBootstrapper()).Create <MainView>();

            LoadingScreen.CloseForm();
            Application.Run(mainForm);
        }
예제 #2
0
        public static void Start()
        {
            if (RuntimeInformation.IsWindows10S)
            {
                MessageBox.Show("Windows 10S is not supported. Computator.NET will exit now.", Strings.Error);
                return;
            }
            LogsConfigurator.Configure();
            EnvironmentLogger.LogEnvironmentInformation();


            if (RuntimeInformation.IsUnix)
            {
                Environment.SetEnvironmentVariable("MONO_WINFORMS_XIM_STYLE", "disabled", EnvironmentVariableTarget.Process);
                //this is because of Bug 436000 - XIM: winforms program crash randomly while starting XIM on Mono
                //see https://bugzilla.novell.com/show_bug.cgi?id=436000
                //https://bugzilla.xamarin.com/show_bug.cgi?id=28047
            }

            Thread.CurrentThread.CurrentCulture         = Settings.Default.Language ?? new CultureInfo("en");
            Thread.CurrentThread.CurrentUICulture       = Settings.Default.Language ?? new CultureInfo("en");
            Application.ThreadException                += Application_ThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            Application.EnableVisualStyles();
            LoadingScreen.ShowSplashScreen();

            GSLInitializer.Initialize();
            Settings.Default.RestoreScriptingExamples();
            Application.SetCompatibleTextRenderingDefault(false);

            if (!RuntimeInformation.IsUnix)
            {
                Application.AddMessageFilter(new MyMessageFilter());//TODO: find a way to redirect messages to underlying controls in Unix
            }
            var mainForm = (new WinFormsBootstrapper()).Create <MainView>();

            LoadingScreen.CloseForm();
            Application.Run(mainForm);
        }
예제 #3
0
        private static void Main()
        {
            Thread.CurrentThread.CurrentCulture         = Settings.Default.Language;
            Thread.CurrentThread.CurrentUICulture       = Settings.Default.Language;
            Application.ThreadException                += Application_ThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;



            Application.EnableVisualStyles();
            LoadingScreen.ShowSplashScreen();

            GSLInitializer.Initialize();

            Application.SetCompatibleTextRenderingDefault(false);
            Application.AddMessageFilter(new MyMessageFilter());

            var mainForm = new MainForm();

            SetPresenters(mainForm);

            LoadingScreen.CloseForm();
            Application.Run(mainForm);
        }