public override bool Execute()
        {
            var excludePaths = Exclude?.Select(exclude => exclude.ItemSpec);

            Output = Process(Input.ItemSpec, excludePaths, OutputPath);
            return(true);
        }
 private void InitializeFilters()
 {
     if (_exclude_filters != null)
     {
         return;
     }
     _exclude_filters = Exclude.Select(f => CreateFilter(f)).ToArray();
     _include_filters = Include.Select(f => CreateFilter(f)).ToArray();
 }
Esempio n. 3
0
        public void Init()
        {
            // Populate compiled matches.
            CompiledMatches = Match.Select((match) =>
                                           new Regex(match)).ToArray();

            // Populate compiled exclusions.
            CompiledExclusions = Exclude.Select((exclusion) =>
                                                new Regex(exclusion)).ToArray();
        }
Esempio n. 4
0
        public override XElement ToXml()
        {
            var element = new XElement("Directory",
                                       new XElement("Path", Path),
                                       new XElement("Include", Include.Select(include => include.ToXml())).ToNullIfEmpty(),
                                       new XElement("Exclude", Exclude.Select(exclude => exclude.ToXml())).ToNullIfEmpty(),
                                       Options.ToXml().ToNullIfEmpty());

            FillXml(element);

            return(element);
        }
 public static string FormatExcludeString(Exclude[] _input)
 {
     return string.Join(",", _input.Select(i => Enum.GetName(typeof(Exclude), i)));
 }
Esempio n. 6
0
 public bool IsExcluded(string dir)
 {
     return(Exclude.Select(RegexHelpers.ToRegex).Any(r => r.IsMatch(dir)));
 }