/// <summary> /// Navigates from the selected node in the tree to its code /// element in the editor window, and gives the editor focus. /// </summary> private void NavigateToSelectedTreeNode() { var codeElement = _control.VisibleTreeView.SelectedNode as CodeElementWrapper; // This can happen if there were no matching code elements. if (codeElement == null) { return; } // Switch to the code window. _editSupport = new EditorSupport(); _editSupport.ActivateCodeWindow(codeElement, Dte); }
/// <summary> /// Occurs when the tree view control is double-clicked. /// </summary> /// <param name="sender">The source TreeView object for this event.</param> /// <param name="e">The EventArgs object that contains the event data.</param> private void codeTreeView_DoubleClick(object sender, EventArgs e) { try { var codeElement = _control.VisibleTreeView.SelectedNode as CodeElementWrapper; // This can happen if there were no matching code elements. if (codeElement == null) { return; } _editSupport = new EditorSupport(); _editSupport.ActivateCodeWindow(codeElement, Dte); } catch (Exception ex) { Utils.DisplayMessage(Resources.ErrorPrefix, "codeTreeView_DoubleClick exception: " + ex); } }