コード例 #1
0
    public void ProcessIncludesExcludes()
    {
        if (ExcludeNamespaces.Any())
        {
            matchers          = GetLines(ExcludeNamespaces).ToList();
            ShouldIncludeType = type =>
            {
                return(matchers.All(matcher => !matcher.Match(type.GetNamespace())) &&
                       !ContainsIgnoreAttribute(type));
            };
            return;
        }

        if (IncludeNamespaces.Any())
        {
            matchers          = GetLines(IncludeNamespaces).ToList();
            ShouldIncludeType = type =>
            {
                return(matchers.Any(lineMatcher => lineMatcher.Match(type.GetNamespace())) &&
                       !ContainsIgnoreAttribute(type));
            };
            return;
        }

        ShouldIncludeType = type => !ContainsIgnoreAttribute(type);
    }
コード例 #2
0
 public void ProcessIncludesExcludes()
 {
     if (ExcludeNamespaces.Any())
     {
         lineMatchers      = GetLines(ExcludeNamespaces).ToList();
         ShouldIncludeType = definition => lineMatchers.All(lineMatcher => !lineMatcher.Match(definition.Namespace)) && !ContainsIgnoreAttribute(definition);
         return;
     }
     if (IncludeNamespaces.Any())
     {
         lineMatchers      = GetLines(IncludeNamespaces).ToList();
         ShouldIncludeType = definition => lineMatchers.Any(lineMatcher => lineMatcher.Match(definition.Namespace)) && !ContainsIgnoreAttribute(definition);
         return;
     }
     ShouldIncludeType = definition => !ContainsIgnoreAttribute(definition);
 }