public static bool SettingsFileIsValid(string settingsFile) { if (!Directory.Exists(Path.GetDirectoryName(settingsFile)) || !File.Exists(settingsFile)) { return(false); } var pDic = new PersistentDictionary(settingsFile, isReadOnly: true); var booksDir = pDic.GetString(nameof(Books)); if (booksDir is null || !Directory.Exists(booksDir)) { return(false); } if (string.IsNullOrWhiteSpace(pDic.GetString(nameof(InProgress)))) { return(false); } return(true); }