Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        public static string GetImportPath()
        {
            string path = Properties.Settings.Default.lastImportPath;

            if (string.IsNullOrEmpty(path))
            {
                return(ProjectUtils.GetProjectDirectory());
            }

            return(path);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }