示例#1
0
        public bool ContainedIn(SymbolFilterData symbol)
        {
            bool result     = false;
            var  attributes = symbol.Attributes;

            foreach (var attribute in attributes)
            {
                if (Uid != attribute.Id)
                {
                    continue;
                }

                // arguments need to be a total match of the config
                if (ConstructorArguments != null && !ConstructorArguments.SequenceEqual(attribute.ConstructorArguments))
                {
                    continue;
                }

                // namedarguments need to be a superset of the config
                if (!ConstructorNamedArguments.Except(attribute.ConstructorNamedArguments).Any())
                {
                    result = true;
                    break;
                }
            }

            return(result);
        }
示例#2
0
 private bool CanVisitCore(IEnumerable <ConfigFilterRuleItemUnion> ruleItems, SymbolFilterData symbol)
 {
     foreach (var ruleUnion in ruleItems)
     {
         ConfigFilterRuleItem rule = ruleUnion.Rule;
         if (rule != null && rule.IsMatch(symbol))
         {
             return(rule.CanVisit);
         }
     }
     return(true);
 }
示例#3
0
        public bool IsMatch(SymbolFilterData symbol)
        {
            if (symbol == null)
            {
                throw new ArgumentNullException("symbol");
            }
            var id = symbol.Id;

            return((_uidRegex == null || (id != null && _uidRegex.IsMatch(id))) &&
                   (Kind == null || Kind.Value.Contains(symbol)) &&
                   (Attribute == null || Attribute.ContainedIn(symbol)));
        }
示例#4
0
 public bool CanVisitAttribute(SymbolFilterData symbol)
 {
     return(this.CanVisitCore(this.AttributeRules, symbol));
 }
示例#5
0
 public bool CanVisitApi(SymbolFilterData symbol)
 {
     return(this.CanVisitCore(this.ApiRules, symbol));
 }