public bool RemoveFilter(string filter, bool bDelete = false) { Filter filterToRemove = FindFilterByName(this, filter); if (filterToRemove == null) return false; string directoryToRemove = string.Format("{0}\\{1}", ProjectUtils.GetProjectDirectory(), filterToRemove.GetFilterDirectory()); filterToRemove.RemoveFiles(bDelete); try { Directory.Delete(directoryToRemove); } catch { LoggingUtils.LogEvent("Unable to delete directory!"); } Filter parentFilter = filterToRemove.GetParent(); if (parentFilter == null) return true; parentFilter.RemoveFilter(filterToRemove); return true; }
public void AddFile(string pathType, string path) { string fullPath = path; if (pathType != "path") fullPath = string.Format("{0}\\{1}", ProjectUtils.GetProjectDirectory(), path); _files.Add(new FilterInfo(fullPath, path, pathType)); }
public static string GetImportPath() { string path = Properties.Settings.Default.lastImportPath; if (string.IsNullOrEmpty(path)) { return(ProjectUtils.GetProjectDirectory()); } return(path); }
public static bool CreateCompileLog(string mdlName, string log, string directoryStructure) { if (!ProjectUtils.IsProjectLoaded()) { return(false); } string logFile = string.Format("{0}\\logs{1}\\{2}.txt", ProjectUtils.GetProjectDirectory(), directoryStructure, Path.GetFileNameWithoutExtension(mdlName)); Directory.CreateDirectory(Path.GetDirectoryName(logFile)); File.WriteAllText(logFile, log); return(true); }
public CompileThread(string path) { _path = path; _log = null; _mdlName = ""; _directoryStructure = (Path.GetDirectoryName(path).Replace(ProjectUtils.GetProjectDirectory(), "")); string content = ""; QCParser qcFile = new QCParser(_path); if (qcFile.ParseQCFile()) { content = qcFile.GetQCContent(); _mdlName = qcFile.GetQCParamValue("$modelname"); if (string.IsNullOrEmpty(_mdlName)) { _mdlName = Path.GetFileName(path); } } _path = string.Format("{0}\\temp\\compile.qc", ProjectUtils.GetProjectDirectory()); File.WriteAllText(_path, content); }