public MainWindow() { InitializeComponent(); this.Dispatcher.ShutdownStarted += this.OnApplicationShutdown; Logger.Init(this.OutputRTB); ConfigSettingFactory.Init(); try { this._authHelper = new GuiPersistentAuthHelper(); this.InitUI(); this.InitKeyboardBindings(); ConfigSettingFactory.RegisterOnChangedEvent(() => { Application.Current.Dispatcher.Invoke(() => { this.InitUI(); }); }); if (this.CheckIsLogin()) { this.PopulateTenant(); if (this._authHelper.AzureEnvironments != ConfigSettingFactory.ConfigSettings.GetAzureEnvironments()) { Logger.WarnLn("Your login session enviroment is '{0}', it is different from your config.json '{1}'", ConfigSettingFactory.ConfigSettings.TargetEnvironment, this._authHelper.AzureEnvironments); } } } catch (Exception ex) { Logger.ErrorLn("{0} {1}", ex.Message, ex.StackTrace); this.ExecuteBtn.IsEnabled = false; } }
private void OnApplicationShutdown(object sender, EventArgs arg) { ConfigSettingFactory.Shutdown(); }