public bool ProcessElement <TResult>(ITreeNode element, IFindResultConsumer <TResult> consumer) { Assertion.Assert(element != null, "The condition (element != null) is false."); var names = new JetHashSet <string>(this.myNames); FindExecution result; if (this.mySearchForLateBound) { result = new LateBoundReferenceSourceFileProcessor <TResult>( element, consumer, this.myElements, this.myHasUnnamedElement ? null : names, names).Run(); } else { var psiSourceFile = element.GetSourceFile(); foreach (var myElement in this.myElements) { var declarations = myElement.GetDeclarationsIn(psiSourceFile); foreach (var declaration in declarations) { var refs = declaration.GetFirstClassReferences(); foreach (var r in refs) { consumer.Accept(new FindResultReference(r, declaration.DeclaredElement)); } } } result = new ReferenceSearchSourceFileProcessor <TResult>( element, true, consumer, this.myElements, this.myHasUnnamedElement ? null : names, names).Run(); } return(result == FindExecution.Stop); }
public bool ProcessElement <TResult>(ITreeNode element, IFindResultConsumer <TResult> consumer) { Assertion.Assert(element != null, "The condition (element != null) is false."); var names = new JetHashSet <string>(myNames); FindExecution result; if (mySearchForLateBound) { result = new LateBoundReferenceSourceFileProcessor <TResult>(element, consumer, myElements, myHasUnnamedElement ? null : names, names).Run(); } else { result = new ReferenceSearchSourceFileProcessor <TResult>(element, true, consumer, myElements, myHasUnnamedElement ? null : names, names).Run(); } return(result == FindExecution.Stop); }
public bool ProcessElement <TResult>(ITreeNode element, IFindResultConsumer <TResult> consumer) { Assertion.Assert(element != null, "The condition (element != null) is false."); var names = new JetHashSet <string>(myNames, StringComparer.OrdinalIgnoreCase); NamedThingsSearchSourceFileProcessor processor; if (mySearchForLateBound) { processor = new LateBoundReferenceSourceFileProcessor <TResult>(element, consumer, myElements, myWordsInText, names); } else { processor = new ReferenceSearchSourceFileProcessor <TResult>(element, myFindCandidates, consumer, myElements, myWordsInText, names); } return(processor.Run() == FindExecution.Stop); }