IsMatch() public method

public IsMatch ( ISymbol symbol ) : bool
symbol ISymbol
return bool
示例#1
0
        private bool CanVisitCore(IEnumerable <ConfigFilterRuleItemUnion> ruleItems, ISymbol symbol, bool wantProtectedMember, IFilterVisitor outer)
        {
            var current = symbol;
            var parent  = symbol.ContainingSymbol;

            while (!(current is INamespaceSymbol) && parent != null)
            {
                if (!outer.CanVisitApi(parent, wantProtectedMember, outer))
                {
                    return(false);
                }

                current = parent;
                parent  = parent.ContainingSymbol;
            }

            foreach (var ruleUnion in ruleItems)
            {
                ConfigFilterRuleItem rule = ruleUnion.Rule;
                if (rule != null && rule.IsMatch(symbol))
                {
                    return(rule.CanVisit);
                }
            }
            return(true);
        }
示例#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);
 }