/// <summary> /// Occurs when the tree view control is entered. /// </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_Enter(object sender, EventArgs e) { try { // Make sure the selected element in the outline window is also selected in the text window. var codeElement = _control.VisibleTreeView.SelectedNode as CodeElementWrapper; _editSupport = new EditorSupport(); _editSupport.GoToCodeElement(codeElement, Dte); } catch (Exception ex) { Utils.DisplayMessage(Resources.ErrorPrefix, "codeTreeView_Enter exception: " + ex); } }
/// <summary> /// Occurs after the tree node is selected. /// </summary> /// <param name="sender">The source TreeView object for this event.</param> /// <param name="e">The TreeViewEventArgs object that contains the event data.</param> private void codeTreeView_AfterSelect(object sender, TreeViewEventArgs e) { try { if ((e.Action == TreeViewAction.ByKeyboard) || (e.Action == TreeViewAction.ByMouse)) { var codeElement = e.Node as CodeElementWrapper; _editSupport = new EditorSupport(); _editSupport.GoToCodeElement(codeElement, Dte); } } catch (Exception ex) { Utils.DisplayMessage(Resources.ErrorPrefix, "codeTreeView_AfterSelect exception: " + ex); } }