private bool MatchesTargetString(ExplorerEFElement explorerElement) { if (null == _targetString) { Debug.Assert(false, "MatchesTargetString() for explorerElement has null _targetString"); return(false); } if (null == _elementTextToSearch) { Debug.Assert(false, "MatchesTargetString() has null _elementTextToSearch delegate"); return(false); } if (null == explorerElement) { Debug.Assert(false, "MatchesTargetString() was passed null explorerElement"); return(false); } if (null == explorerElement.ModelItem) { Debug.Fail( "MatchesTargetString() was passed explorerElement with null Model item (name = " + explorerElement.Name + ")"); return(false); } var stringToMatch = _elementTextToSearch(explorerElement.ModelItem); return(SearchVisitor.StringToSearchContainsTargetString(stringToMatch, _targetString)); }