Example #1
0
        /// <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);
        }
Example #2
0
 /// <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)
     {
         DisplayMessage(Resources.ErrorPrefix, "codeTreeView_Enter exception: " + ex);
     }
 }
Example #3
0
 /// <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)
     {
         DisplayMessage(Resources.ErrorPrefix, "codeTreeView_AfterSelect exception: " + ex);
     }
 }
Example #4
0
        /// <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)
            {
                DisplayMessage(Resources.ErrorPrefix, "codeTreeView_DoubleClick exception: " + ex);
            }
        }
Example #5
0
 /// <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)
     {
         DisplayMessage(Resources.ErrorPrefix, "codeTreeView_Enter exception: " + ex);
     }
 }
Example #6
0
        /// <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)
            {
                DisplayMessage(Resources.ErrorPrefix, "codeTreeView_DoubleClick exception: " + ex);
            }
        }
Example #7
0
 /// <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)
     {
         DisplayMessage(Resources.ErrorPrefix, "codeTreeView_AfterSelect exception: " + ex);
     }
 }
Example #8
0
        /// <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);
        }