Exemplo n.º 1
0
        public MessagingVisualizerContainer(SyntaxVisualizerToolWindow parentWindow)
        {
            parent = parentWindow;
            InitializeComponent();

            //syntaxVisualizerContainer = new SyntaxVisualizerContainer();
            //commandVisualizerContainer = new CommandVisualizerContainer();

            //var syntaxTab = new TabItem
            //                    {
            //                        Header = "Syntax Visualizer",
            //                        HorizontalAlignment = HorizontalAlignment.Stretch,
            //                        VerticalAlignment = VerticalAlignment.Top,
            //                        Content = syntaxVisualizerContainer
            //                    };

            //var commandTab = new TabItem
            //                     {
            //                         Header = "Command Visualizer",
            //                         Content = commandVisualizerContainer,
            //                         HorizontalAlignment = HorizontalAlignment.Stretch,
            //                         VerticalAlignment = VerticalAlignment.Top,
            //                     };

            //((TabItem)visualizerTabs.Items.GetItemAt(0)).Content = syntaxTab;
            //((TabItem)visualizerTabs.Items.GetItemAt(1)).Content = commandTab;
        }
Exemplo n.º 2
0
        internal SyntaxVisualizerContainer(SyntaxVisualizerToolWindow parent)
        {
            InitializeComponent();

            this.parent = parent;

            InitializeRunningDocumentTable();

            var shellService = GetService <IVsShell, SVsShell>(GlobalServiceProvider);

            if (shellService != null)
            {
                int canDisplayDirectedSyntaxGraph;

                // Only enable this feature if the Visual Studio package for DGML is installed.
                shellService.IsPackageInstalled(GuidList.GuidProgressionPkg, out canDisplayDirectedSyntaxGraph);
                syntaxVisualizer.DirectedSyntaxGraphContextMenuEnabled = Convert.ToBoolean(canDisplayDirectedSyntaxGraph);
            }

            syntaxVisualizer.SyntaxNodeNavigationToSourceRequested   += node => NavigateToSource(node.Span);
            syntaxVisualizer.SyntaxTokenNavigationToSourceRequested  += token => NavigateToSource(token.Span);
            syntaxVisualizer.SyntaxTriviaNavigationToSourceRequested += trivia => NavigateToSource(trivia.Span);

            syntaxVisualizer.SyntaxNodeDirectedGraphRequested   += DisplaySyntaxNodeDgml;
            syntaxVisualizer.SyntaxTokenDirectedGraphRequested  += DisplaySyntaxTokenDgml;
            syntaxVisualizer.SyntaxTriviaDirectedGraphRequested += DisplaySyntaxTriviaDgml;
        }