Esempio n. 1
0
        public IEnumerable<string> SubstitutionValueInPattern(List<string> values, PathLevelWithRegex basePath, FilePathRegexInformation regexInformation)
        {
            var paths = new List<string>();
            foreach (string path in values)
            {
                var level  = basePath.Level;
                if (!regexInformation.IsWindowsFilepath())
                    level -= 1;

                var concatenatedString = regexInformation.ConcatPathWithNextLeveRegex(path, level);
                if (!string.IsNullOrEmpty(concatenatedString))
                    paths.Add(concatenatedString);
            }

            return paths;
        }        
Esempio n. 2
0
        private List<string> EvaluateOperationPatternMatchOfPath(IEnumerable<string> paths)
        {
            var values = new List<string>();
            foreach (string path in paths)
            {
                var regexInformation = new FilePathRegexInformation(path);
                var basePath = regexInformation.GetPathWithFirstRegex();
                if (basePath != null)
                {
                    var result = this.searchFileChildren(path, true);
                    if (regexInformation.IsWindowsFilepath())
                        result = this.removeFilesFromList(result);

                    var multiLevelPatternMatchOperator = new MultiLevelPatternMatchOperation(this.Platform);
                    var valuesWithMatch = multiLevelPatternMatchOperator.applyPatternMatch(path, result).ToList();
                    //var newPaths = this.SubstitutionValueInPattern(valuesWithMatch, basePath, regexInformation);
                    //if (newPaths.Count() > 0)
                    //    values.AddRange(this.EvaluateOperationPatternMatchOfPath(newPaths));
                    //else
                        values.AddRange(valuesWithMatch);
                }
            }
            return values;
        }