Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void AfterInitializationCallToGslMethodShouldNotThrow()
        {
            var messengingServiceMock = new Mock <IMessagingService>();

            GSLInitializer.Initialize(messengingServiceMock.Object);

            Assert.DoesNotThrow(() => NativeMethods.gsl_set_error_handler_off());
        }
Ejemplo n.º 3
0
        public void InitializationShouldNotCallMessengingServiceUnlessThereIsAnError()
        {
            var messengingServiceMock = new Mock <IMessagingService>();

            messengingServiceMock.Setup(m => m.Show(It.IsAny <string>(), It.IsAny <string>())).Verifiable();

            GSLInitializer.Initialize(messengingServiceMock.Object);

            messengingServiceMock.Verify(m => m.Show(It.IsAny <string>(), It.IsAny <string>()), Times.Never);
        }
Ejemplo n.º 4
0
        public void AfterInitializationCallToGslSpecialFunctionShouldNotThrow()
        {
            GSLInitializer.Initialize();

            var x = double.MinValue;

            Assert.DoesNotThrow(() => x = SpecialFunctions.Debye(2, 10));

            Assert.AreNotEqual(double.MinValue, x);
        }
Ejemplo n.º 5
0
        public void AfterInitializationCallToGslSpecialFunctionShouldNotThrow()
        {
            var messengingServiceMock = new Mock <IMessagingService>();

            GSLInitializer.Initialize(messengingServiceMock.Object);

            var x = double.MinValue;

            Assert.DoesNotThrow(() => x = SpecialFunctions.Debye(2, 10));

            Assert.AreNotEqual(double.MinValue, x);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
0
        public void InitializationShouldNotThrow()
        {
            var messengingServiceMock = new Mock <IMessagingService>();

            Assert.DoesNotThrow(() => GSLInitializer.Initialize(messengingServiceMock.Object));
        }
 public void Init()
 {
     C = (from d1 in X from d2 in X select new Complex(d1, d2)).ToArray();
     GSLInitializer.Initialize();
 }
Ejemplo n.º 10
0
 public Startup(IConfiguration configuration)
 {
     GSLInitializer.Initialize();
     Configuration = configuration;
 }
Ejemplo n.º 11
0
 public void Init()
 {
     _expressionsEvaluator = new ExpressionsEvaluator();
     GSLInitializer.Initialize();
 }
 public void Init()
 {
     _c = (from d1 in _x from d2 in _x select new Complex(d1, d2)).ToArray();
     Settings.Default.CalculationsErrors = CalculationsErrors.ReturnNAN;
     GSLInitializer.Initialize();
 }
Ejemplo n.º 13
0
 public void Setup()
 {
     _messegingServiceMock.Setup(m => m.Show(It.IsAny <string>(), It.IsAny <string>())).Verifiable();
     GSLInitializer.Initialize();
 }
Ejemplo n.º 14
0
        public void AfterInitializationCallToGslMethodShouldNotThrow()
        {
            GSLInitializer.Initialize();

            Assert.DoesNotThrow(() => NativeMethods.gsl_set_error_handler_off());
        }
 public void Init()
 {
     C = (from d1 in X from d2 in X select new Complex(d1, d2)).ToArray();
     Settings.Default.CalculationsErrors = CalculationsErrors.ReturnNAN;
     GSLInitializer.Initialize(new Mock <IMessagingService>().Object);
 }
 public void Init()
 {
     _expressionsEvaluator = new ExpressionsEvaluator();
     GSLInitializer.Initialize(new Mock <IMessagingService>().Object);
 }