public static FileInclusionPolicy CreateInclusionPolicy(IEnumerable<string> excludes = null, IEnumerable<string> includes = null)
 {
     var policy = new FileInclusionPolicy();
     if (excludes != null) excludes.Each(policy.AddExclude);
     if(includes != null) includes.Each(policy.AddInclude);
     return policy;
 }
        public IFileInclusionHierarchy Combine(IFileInclusionHierarchy hierarchy, FileInclusionPolicy secondPolicy)
        {
            if (hierarchy == null) throw new ArgumentNullException("hierarchy");
            if (secondPolicy == null) throw new ArgumentNullException("secondPolicy");

            var newPolicy = new FileInclusionPolicy();
            AddFrom(hierarchy.Policy, newPolicy);
            AddFrom(secondPolicy, newPolicy);

            return new FileInclusionHierarchy(wildcardMatcher, newPolicy);
        }
 static void AddFrom(FileInclusionPolicy from, FileInclusionPolicy to)
 {
     from.ExcludeFilters.Each(to.AddExclude);
     from.IncludeFilters.Each(to.AddInclude);
 }
 public IFileInclusionHierarchy Create(FileInclusionPolicy initalPolicy)
 {
     return new FileInclusionHierarchy(wildcardMatcher, initalPolicy);
 }
 public FileInclusionHierarchy(IWildcardMatcher wildcardMatcher, FileInclusionPolicy policy)
 {
     this.wildcardMatcher = wildcardMatcher;
     Policy = policy;
 }