private void FileExistenceControl() { if (listPath == string.Empty) { CreateFileAndSave(); } else if (listPath != string.Empty) { SaveLoadController.SaveList(true, SaveButton, currentSection, currentListView); } }
private void CreateFileAndSave() { savefiledialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); savefiledialog.RestoreDirectory = true; savefiledialog.FileName = currentSection + "list"; savefiledialog.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"; if (savefiledialog.ShowDialog() == DialogResult.OK) { settingsForm.SetFilePath(currentSection, savefiledialog.FileName); settingsForm.SaveSettings(); GetFilePath(); SaveLoadController.SetPaths(listPath); SaveLoadController.SaveList(true, SaveButton, currentSection, currentListView); } else { settingsForm.GetAllFilePathsFromProperties(); } }