// Remove a BO from the file system internal static void DeleteBO(BuildOrder selectedItem) { string directory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + folderName; string path = string.Concat(directory, selectedItem.ToPath()); if (!File.Exists(path)) { Console.WriteLine("Error deleting BuildOrder. File not found. Maybe the name of the file is not the name of the BO."); } File.Delete(path); }
// Save a BO file public static void SaveBO(BuildOrder bo) { using (StreamWriter file = new StreamWriter(string.Concat(DirectoryPath(), bo.ToPath()))) { file.Write(bo.ToFormat()); } }