/// <summary> /// Save this configuration list. /// </summary> static internal void SaveList(string path, List <string> list) { if (list.size > 0) { if (!File.Exists(path) && !string.IsNullOrEmpty(Tools.applicationDirectory)) { path = Tools.GetDocumentsPath(path); } string dir = Path.GetDirectoryName(path); if (!string.IsNullOrEmpty(dir) && !Directory.Exists(dir)) { Directory.CreateDirectory(dir); } StreamWriter sw = new StreamWriter(path, false); for (int i = 0; i < list.size; ++i) { sw.WriteLine(list[i]); } sw.Close(); } else { Tools.DeleteFile(path); } }
/// <summary> /// Delete the specified file. /// </summary> public bool DeleteFile(string fileName) { if (Tools.DeleteFile(string.IsNullOrEmpty(rootDirectory) ? fileName : Path.Combine(rootDirectory, fileName))) { mSavedFiles.Remove(fileName); return(true); } return(false); }
/// <summary> /// Delete the specified file. /// </summary> public bool DeleteFile(string fileName) { if (Tools.DeleteFile(fileName)) { mSavedFiles.Remove(fileName); return(true); } return(false); }
/// <summary> /// Delete the specified file. /// </summary> public void DeleteFile(string fileName) { mSavedFiles.Remove(fileName); Tools.DeleteFile(fileName); }