Esempio n. 1
0
        private void tvTree_DoubleClick(object sender, EventArgs e)
        {
            if (tvTree.SelectedNode != null && tcFiles.SelectedIndex > -1)
            {
                TreeNode selectedNode = tvTree.SelectedNode;
                if (selectedNode.Level > 0)
                {
                    TreeNode parentNode = selectedNode.Parent;
                    while (parentNode != null)
                    {
                        if (parentNode.Parent != null)
                        {
                            parentNode = parentNode.Parent;
                        }
                        else
                        {
                            break;
                        }
                    }

                    if (parentNode != null)
                    {
                        EditorState editorState = (EditorState)parentNode.Tag;
                        TabPage     tab         = (TabPage)editorState.Tag;
                        tcFiles.SelectedTab = tab;
                        tcFiles.Focus();
                        DoxygenNode entityNode = (DoxygenNode)selectedNode.Tag;
                        editorState.GoToPosition(entityNode.Entity.StartRange.Index);
                    }
                }
            }
        }
Esempio n. 2
0
 private void Issues_ItemDoubleClick(object sender, ListViewItem item)
 {
     if (item != null && item.Tag != null)
     {
         IssueTag     tag   = (IssueTag)item.Tag;
         TextPosition pos   = tag.Pos;
         EditorState  state = tag.State;
         TabPage      tab   = (TabPage)state.Tag;
         tcFiles.SelectedTab = tab;
         state.GoToPosition(pos.Index);
     }
 }
Esempio n. 3
0
        private void MenuActionEditGoToSymbol(object sender, EventArgs e)
        {
            Debug.Assert(tcFiles.SelectedTab != null);
            EditorState editorState = (EditorState)tcFiles.SelectedTab.Tag;

            if (editorState.DoxyTree != null)
            {
                List <SymbolItemModel> symbols = new List <SymbolItemModel>();
                HashSet <string>       types   = new HashSet <string>();

                // @TODO(final): Implement this for BaseTree!
                var allSources = SymbolCache.GetSources(editorState);
                foreach (var source in allSources)
                {
                    if (source.Value.Node == null)
                    {
                        continue;
                    }
                    symbols.Add(new SymbolItemModel()
                    {
                        Caption  = null,
                        Id       = source.Key,
                        Type     = source.Value.Kind.ToString(),
                        Position = source.Value.Range.Position,
                    });
                    types.Add(source.Value.Kind.ToString());
                }

                SymbolSearchForm form = new SymbolSearchForm(symbols, types);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    SymbolItemModel selectedItem = form.SelectedItem;
                    editorState.GoToPosition(selectedItem.Position.Index);
                }
            }
        }