/// <summary> /// Do some final checks before main window is allowed to load /// </summary> private void StartupCheck() { CheckForUpdates(); if (!IsNormalStart()) { App.UserSettings = UserSettingsHelper.ReadUserSettings(); var auth = _enterPassVm(); var isAuth = _windowManager.ShowDialog(auth); if (isAuth == true) { App.UserSettings = UserSettingsHelper.ReadUserSettings();//read for any changed user settings CheckForImportDb(); } else { Environment.Exit(0);//closed auth window } } else { CheckDbError(); } }
//TODO: Is this being used? public static void LoadUserSettings() { try { var settings = UserSettingsHelper.ReadUserSettings(); App.UserSettings = settings; } catch (Exception ex) { App.Logger.Error(ex, "Couldn't load config file"); throw; } }
private static bool IsNormalStart() { var configFile = Path.Combine(App.ConfigDirPath, @"config\config.json"); if (!File.Exists(configFile)) { return(false); } if (!UserSettingsHelper.ValidateConfigFile()) { return(false); } if (CredentialManager.GetCredentials(App.CredDb) == null) { return(false); } App.UserSettings = UserSettingsHelper.ReadUserSettings(); var useEncryption = App.UserSettings.RequirePasswordEntry; return(!useEncryption); }