/// <summary> /// Traverse a directory and load all history XML files stored there into a list of presets. /// </summary> /// <param name="folderPath">Path to load history from. Default is .\History.</param> /// <returns>True if successful, false otherwise</returns> public bool ReadFromFolderPath(string folderPath = @".\History") { bool ret; try { foreach (var file in Directory.EnumerateFiles(folderPath, "*.xml")) { var preset = new SearchPreset(file); Presets.Add(preset); } ret = true; } catch (Exception) { ret = false; } return(ret); }
private void AddPreset(string file) { var preset = new SearchPreset(file); Presets.Add(preset); }