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); }
public void AfterInitializationCallToGslMethodShouldNotThrow() { var messengingServiceMock = new Mock <IMessagingService>(); GSLInitializer.Initialize(messengingServiceMock.Object); Assert.DoesNotThrow(() => NativeMethods.gsl_set_error_handler_off()); }
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); }
public void AfterInitializationCallToGslSpecialFunctionShouldNotThrow() { GSLInitializer.Initialize(); var x = double.MinValue; Assert.DoesNotThrow(() => x = SpecialFunctions.Debye(2, 10)); Assert.AreNotEqual(double.MinValue, x); }
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); }
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); }
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); }
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(); }
public Startup(IConfiguration configuration) { GSLInitializer.Initialize(); Configuration = configuration; }
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(); }
public void Setup() { _messegingServiceMock.Setup(m => m.Show(It.IsAny <string>(), It.IsAny <string>())).Verifiable(); GSLInitializer.Initialize(); }
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); }