public RoslynSyntaxVisualizer()
        {
            store    = new TreeStore(markupField, spanField, nodeField);
            treeView = new TreeView(store)
            {
                BorderVisible  = false,
                HeadersVisible = false,
            };

            treeView.Columns.Add("Text", new TextCellView {
                MarkupField = markupField
            });

            Add1((Gtk.Widget)Toolkit.CurrentEngine.GetNativeWidget(treeView));

            propertyGrid = new PropertyGrid();
            Add2(propertyGrid);
            ShowAll();
            propertyGrid.ShowToolbar = false;

            EditorTagVisualizer.LoadPropertyEditorAssembly(propertyGrid, typeof(RoslynSyntaxVisualizer).Assembly);

            //FIXME: port to XWT so we can use percentage position
            Position = 600;

            editorTracker = new ActiveEditorTracker();
            editorTracker.ActiveEditorChanged += ActiveEditorChanged;
            ActiveEditorChanged(editorTracker, new ActiveEditorChangedEventArgs(editorTracker.TextView, null, editorTracker.Document, null));

            treeView.SelectionChanged += SelectionChangedHandler;
        }
Esempio n. 2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                editorTracker?.Dispose();
                editorTracker = null;
            }

            base.Dispose(disposing);
        }
Esempio n. 3
0
        public RoslynSyntaxVisualizer()
        {
            Columns.Add("Text", new TextCellView {
                MarkupField = markupField
            });
            HeadersVisible = false;
            BorderVisible  = false;

            store      = new TreeStore(markupField, spanField);
            DataSource = store;

            editorTracker = new ActiveEditorTracker();
            editorTracker.ActiveEditorChanged += ActiveEditorChanged;
            ActiveEditorChanged(editorTracker, new ActiveEditorChangedEventArgs(editorTracker.TextView, null, editorTracker.Document, null));

            SelectionChanged += SelectionChangedHandler;
        }
Esempio n. 4
0
        public EditorTagVisualizer()
        {
            tagAggregatorFactoryService = CompositionManager.Instance.GetExportedValue <IViewTagAggregatorFactoryService> ();

            store    = new TreeStore(spanField, tagNameMarkupField, tagField);
            treeView = new TreeView(store)
            {
                BorderVisible  = false,
                HeadersVisible = false,
            };
            treeView.Columns.Add("Span", spanField).Expands = false;
            treeView.Columns.Add("Tag", new TextCellView {
                MarkupField = tagNameMarkupField
            }).Expands = true;

            Add1((Gtk.Widget)Toolkit.CurrentEngine.GetNativeWidget(treeView));

            propertyGrid = new PropertyGrid();
            Add2(propertyGrid);
            ShowAll();
            propertyGrid.ShowToolbar = false;

            //FIXME: port to XWT so we can use percentage position
            Position = 600;

            LoadPropertyEditorAssembly(propertyGrid, typeof(EditorTagVisualizer).Assembly);

            treeView.SelectionChanged += SelectionChanged;

            editorTracker = new ActiveEditorTracker();
            editorTracker.ActiveEditorChanged += ActiveEditorChanged;
            if (editorTracker.TextView != null)
            {
                ActiveEditorChanged(editorTracker, new ActiveEditorChangedEventArgs(editorTracker.TextView, null, editorTracker.Document, null));
            }
        }