private ICodeExplorerNode FindTargetNode() { using (var active = _vbe.ActiveCodePane) { if (active == null || active.IsWrappingNullReference) { using (var project = _vbe.ActiveVBProject) { if (project == null || project.IsWrappingNullReference) { return(null); } var declaration = _state.DeclarationFinder.UserDeclarations(DeclarationType.Project) .FirstOrDefault(item => item.ProjectId.Equals(project.ProjectId)); return(_explorer.FindVisibleNodeForDeclaration(declaration)); } } var selected = _state.DeclarationFinder?.FindSelectedDeclaration(active); return(selected == null ? null : _explorer.FindVisibleNodeForDeclaration(selected)); } }
private ICodeExplorerNode FindTargetNode() { var targetDeclaration = FindTargetDeclaration(); return(targetDeclaration != null ? _explorer.FindVisibleNodeForDeclaration(targetDeclaration) : null); }