public IEnumerable<IStructuralMatchResult> Search(IRegistrationPattern patern)
        {
            var results = new List<IStructuralMatchResult>();
            var consumer = new FindResultConsumer<IStructuralMatchResult>(result =>
            {
                var findResultStructural = result as FindResultStructural;
                if (findResultStructural != null && findResultStructural.DocumentRange.IsValid())
                {
                    return findResultStructural.MatchResult;
                }

                return null;
            }, match =>
            {
                if (match != null)
                {
                    results.Add(match);
                }
                return FindExecution.Continue;
            });

            DoSearch(patern.Matcher, consumer);

            return results;
        }
示例#2
0
        public IEnumerable <IStructuralMatchResult> Search(IRegistrationPattern patern)
        {
            var results  = new List <IStructuralMatchResult>();
            var consumer = new FindResultConsumer <IStructuralMatchResult>(result =>
            {
                var findResultStructural = result as FindResultStructural;
                if (findResultStructural != null && findResultStructural.DocumentRange.IsValid())
                {
                    return(findResultStructural.MatchResult);
                }

                return(null);
            }, match =>
            {
                if (match != null)
                {
                    results.Add(match);
                }
                return(FindExecution.Continue);
            });

            DoSearch(patern.Matcher, consumer);

            return(results);
        }
示例#3
0
 public CompositePattern(IRegistrationPattern pattern, params IBasedOnPattern[] basedOnPatterns)
     : base(pattern.Pattern)
 {
     this.pattern         = pattern;
     this.basedOnPatterns = basedOnPatterns;
 }
 public CompositePattern(IRegistrationPattern pattern, params IBasedOnPattern[] basedOnPatterns)
     : base(pattern.Pattern)
 {
     this.pattern = pattern;
     this.basedOnPatterns = basedOnPatterns;
 }