private string SettingsPath() { string path = DirectoryFinder.UserAppDataFolder(m_appName); Directory.CreateDirectory(path); path = Path.Combine(path, "DialogResponses.xml"); return(path); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Get rid of old obsolete files from previous versions /// </summary> /// ------------------------------------------------------------------------------------ private void CleanupOldFiles() { try { string path = DirectoryFinder.UserAppDataFolder(ApplicationName); if (Directory.Exists(path)) { List <string> oldFilesList = new List <string>(Directory.GetFiles(path, "TE.TBDef.tb*.xml")); string oldDiffFile = Path.Combine(path, "TBDef.DiffView.tbDiffView.xml"); if (File.Exists(oldDiffFile)) { oldFilesList.Add(oldDiffFile); } foreach (string oldFile in oldFilesList) { File.SetAttributes(oldFile, FileAttributes.Normal); File.Delete(oldFile); } } } catch { /* Ignore any failures. */ } }