コード例 #1
0
        public DAXEditor()
        {
            //SearchPanel.Install(this.TextArea);
            var brush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#C8FFA55F")); //orange // grey FFE6E6E6

            HighlightBackgroundBrush        = brush;
            this.TextArea.SelectionChanged += textEditor_TextArea_SelectionChanged;
            TextView textView = this.TextArea.TextView;

            // Add Bracket Highlighter
            _bracketRenderer = new BracketHighlightRenderer(textView);
            textView.BackgroundRenderers.Add(_bracketRenderer);
            //textView.LineTransformers.Add(_bracketRenderer);
            textView.Services.AddService(typeof(BracketHighlightRenderer), _bracketRenderer);

            // Add Syntax Error marker
            textMarkerService = new TextMarkerService(this);
            textView.BackgroundRenderers.Add(textMarkerService);
            textView.LineTransformers.Add(textMarkerService);
            textView.Services.AddService(typeof(TextMarkerService), textMarkerService);

            // add handlers for tooltip error display
            textView.MouseHover         += TextEditorMouseHover;
            textView.MouseHoverStopped  += TextEditorMouseHoverStopped;
            textView.VisualLinesChanged += VisualLinesChanged;

            //textView.PreviewKeyUp += TextArea_PreviewKeyUp;
            // add the stub Intellisense provider
            IntellisenseProvider = new IntellisenseProviderStub();

            this.DocumentChanged += DaxEditor_DocumentChanged;
        }
コード例 #2
0
ファイル: DAXEditor.cs プロジェクト: votrongdao/DaxStudio
        public DAXEditor()
        {
            //SearchPanel.Install(this.TextArea);
            var brush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#C8FFA55F")); //orange // grey FFE6E6E6
            HighlightBackgroundBrush = brush;
            this.TextArea.SelectionChanged += textEditor_TextArea_SelectionChanged;
            TextView textView = this.TextArea.TextView;

            // Add Bracket Highlighter
            _bracketRenderer = new BracketHighlightRenderer(textView);
            textView.BackgroundRenderers.Add(_bracketRenderer);
            //textView.LineTransformers.Add(_bracketRenderer);
            textView.Services.AddService(typeof(BracketHighlightRenderer), _bracketRenderer);

            // Add Syntax Error marker
            textMarkerService = new TextMarkerService(this);
            textView.BackgroundRenderers.Add(textMarkerService);
            textView.LineTransformers.Add(textMarkerService);
            textView.Services.AddService(typeof(TextMarkerService), textMarkerService);

            // add handlers for tooltip error display
            textView.MouseHover += TextEditorMouseHover;
            textView.MouseHoverStopped += TextEditorMouseHoverStopped;
            textView.VisualLinesChanged += VisualLinesChanged;

            //textView.PreviewKeyUp += TextArea_PreviewKeyUp;
            // add the stub Intellisense provider
            IntellisenseProvider = new IntellisenseProviderStub();

            this.DocumentChanged += DaxEditor_DocumentChanged;
        }