/// <summary> /// Initializes a new instance of the <see cref="App"/> class. /// </summary> public App() { this.MainWindow = new MainWindow(); ViewService.Configure(e => e.RootWindow = this.MainWindow); PluginContext.Configuration.BenchmarkEnabled = bool.Parse(ConfigurationManager.AppSettings["BenchmarkEnabled"]); PluginContext.Configuration.AutomaticContextMenu = Settings.Default.AutomaticContextMenu; PluginContext.Configuration.ExecutionTimeThreshold = uint.Parse(ConfigurationManager.AppSettings["ExecutionTimeThreshold"]); PluginContext.Configuration.SearchType = Settings.Default.SearchType; PluginContext.Configuration.DownloadSite = ConfigurationManager.AppSettings["DownloadSite"]; if (this.arguments.DebugTools) { this.Logger.Warn("Debug statistics are activated!"); } if (this.arguments.AdminTool) { this.Logger.Warn("Debug tools are activated!"); } var splash = new MySplashScreen(); try { splash.ShowDialog(); } catch (Exception ex) { this.Logger.Error("An error occured in the spashscreen", ex); throw ex; } if (!splash.IsOnError) { this.Logger.Info(PluginContext.DbConfiguration.IsRemoteStatisticsEnabled ? "Remote statistics are enabled" : "Remote statistics are disabled"); this.Logger.Info(PluginContext.DbConfiguration.NotifyOnNewVersion ? "Notify on new version" : "Do NOT notify on new version"); this.SetConfiguration(); this.MainWindow.Show(); this.CheckDebugTools(); this.CleanGui(); this.MainWindow.As <MainWindowViewModel>().CheckNewVersion(); } else { Application.Current.Shutdown(); } }
/// <summary> /// Initializes a new instance of the <see cref="App"/> class. /// </summary> public App() { this.MainWindow = new MainWindow(); ViewService.Configure(e => e.RootWindow = this.MainWindow); PluginContext.Configuration.BenchmarkEnabled = bool.Parse(ConfigurationManager.AppSettings["BenchmarkEnabled"]); PluginContext.Configuration.AutomaticContextMenu = Settings.Default.AutomaticContextMenu; PluginContext.Configuration.ExecutionTimeThreshold = uint.Parse(ConfigurationManager.AppSettings["ExecutionTimeThreshold"]); PluginContext.Configuration.SearchType = Settings.Default.SearchType; PluginContext.Configuration.DownloadSite = ConfigurationManager.AppSettings["DownloadSite"]; if (this.arguments.DebugTools) { this.Logger.Warn("Debug statistics are activated!"); } if (this.arguments.AdminTool) { this.Logger.Warn("Debug tools are activated!"); } var splash = new MySplashScreen(); try { splash.ShowDialog(); } catch (Exception ex) { this.Logger.Error("An error occured in the spashscreen", ex); throw ex; } if (!splash.IsOnError) { this.Logger.Info(PluginContext.DbConfiguration.IsRemoteStatisticsEnabled ? "Remote statistics are enabled" : "Remote statistics are disabled"); this.Logger.Info(PluginContext.DbConfiguration.NotifyOnNewVersion ? "Notify on new version" : "Do NOT notify on new version"); this.SetConfiguration(); this.MainWindow.Show(); this.CheckDebugTools(); this.CleanGui(); this.MainWindow.As<MainWindowViewModel>().CheckNewVersion(); } else { Application.Current.Shutdown(); } }