/// <summary> /// Remove the supplied countries overall file. /// </summary> /// <param name="file"></param> public static void RemoveFile(OverallFile file) { if (File.Exists(overallFiles[(int)file])) { File.Delete(overallFiles[(int)file]); } }
/// <summary> /// Create the supplied type of overall data storage file (JSON file) /// </summary> /// <param name="file">The overall file indexer that needs to be created.</param> public static void CreateFile(OverallFile file) { try { File.Create(Path.Combine(DirectoryUtils.AppDir, overallFiles[(int)file])); } catch (Exception ex) { MessageBox.Show(ex.Message, "Overall Data Storage File Creation Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } }
/// <summary> /// Returns whether or not the overall data file exists. /// </summary> /// <param name="file"></param> /// <returns></returns> public static bool DataFileExists(OverallFile file) => File.Exists(overallFiles[(int)file]);