public static void RemoveCodeAndDataDirs(bool confirmNeeded, string subject, string algorithm) { string subjectCodePath = ClassFactory.GenerateSubjectPath(subject); string subjectDataPath = Config.Instance.GenerateSubjectPath(subject); if (!(HasFiles(subjectCodePath) || HasFiles(subjectDataPath))) { if (CustomizedMessageBox.Show(new List <string> { "The subject CODE and DATA directories are empty. Do you want to delete them?" }, "FileUtils Message", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Directory.Delete(subjectCodePath, true); Directory.Delete(subjectDataPath, true); return; } } string algorithmCodePath = ClassFactory.GenerateAlgorithmPath(subject, algorithm); string algorithmDataPath = Config.Instance.GenerateAlgorithmPath(subject, algorithm); if (!(HasFiles(algorithmCodePath) || HasFiles(algorithmDataPath))) { if (CustomizedMessageBox.Show(new List <string> { "The algorithm CODE and DATA directories are empty. Do you want to delete them?" }, "FileUtils Message", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Directory.Delete(algorithmCodePath, true); Directory.Delete(algorithmDataPath, true); return; } } }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn public static void CreateCodeDir(string subject, string algorithm) /// /// \brief Creates code dir. /// /// \par Description. /// /// \par Algorithm. /// /// \par Usage Notes. /// /// \author Ilanh /// \date 13/12/2017 /// /// \param subject (string) - The subject. /// \param algorithm (string) - The algorithm. //////////////////////////////////////////////////////////////////////////////////////////////////// public static void CreateCodeDir(string subject, string algorithm) { string subjectPath = ClassFactory.GenerateSubjectPath(subject); if (!Directory.Exists(subjectPath)) { CreateDirectory(Path.GetFullPath(subjectPath)); } string algorithmPath = ClassFactory.GenerateAlgorithmPath(subject, algorithm); if (!Directory.Exists(algorithmPath)) { CreateDirectory(Path.GetFullPath(algorithmPath)); } }