public bool IsMatched(IContext context)
 {
     if (context != null && AspectPathPatternMatcher == null)
     {
         return(ContextPathPatternMatcher.IsMatched(context.Path));
     }
     return(false);
 }
 public bool IsMatched(IAspect aspect)
 {
     if (aspect != null && AspectPathPatternMatcher != null)
     {
         IContext context = aspect.Context;
         return(context != null &&
                ContextPathPatternMatcher.IsMatched(context.Path) &&
                AspectPathPatternMatcher.IsMatched(aspect.Path));
     }
     return(false);
 }
Exemple #3
0
        private bool Until<T1>(PatternMatcher matcher, Func<T1, bool> callback, bool breakCondition) where T1 : class, IInDictElement {
            bool result = !breakCondition;

            var en = _Elements.GetEnumerator();
            while (en.MoveNext()) {
                if (en.Current.Value is T1) {
                    bool matched = (matcher == null) ||matcher.IsMatched(en.Current.Key);
                    if (matched) {
                        if (callback(en.Current.Value as T1) == breakCondition) {
                            result = breakCondition;
                            break;
                        }
                    }
                }
            }
            return result;
        }