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); }
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); }
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))); }
public bool CanVisitAttribute(SymbolFilterData symbol) { return(this.CanVisitCore(this.AttributeRules, symbol)); }
public bool CanVisitApi(SymbolFilterData symbol) { return(this.CanVisitCore(this.ApiRules, symbol)); }