Exemplo n.º 1
0
        // TODO: move this into SharpDevelopTextEditor
        public void UpdateCustomizedHighlighting()
        {
            string language = this.SyntaxHighlighting != null ? this.SyntaxHighlighting.Name : null;

            CustomizableHighlightingColorizer.ApplyCustomizationsToDefaultElements(this, FetchCustomizations(language));
            BracketHighlightRenderer.ApplyCustomizationsToRendering(this.bracketRenderer, FetchCustomizations(language));
            this.TextArea.TextView.Redraw();             // manually redraw if default elements didn't change but customized highlightings did
        }
 public static void ApplyCustomizationsToRendering(BracketHighlightRenderer renderer, IEnumerable <CustomizedHighlightingColor> customizations)
 {
     renderer.UpdateColors(DefaultBackground, DefaultBorder);
     foreach (CustomizedHighlightingColor color in customizations)
     {
         if (color.Name == BracketHighlight)
         {
             renderer.UpdateColors(color.Background ?? Colors.Blue, color.Foreground ?? Colors.Blue);
         }
     }
 }
Exemplo n.º 3
0
        public CodeEditorView()
        {
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Help, OnHelpExecuted));

            this.bracketRenderer         = new BracketHighlightRenderer(this.TextArea.TextView);
            this.caretReferencesRenderer = new CaretReferencesRenderer(this);
            this.contextActionsRenderer  = new ContextActionsRenderer(this);

            UpdateCustomizedHighlighting();

            this.MouseHover                           += TextEditorMouseHover;
            this.MouseHoverStopped                    += TextEditorMouseHoverStopped;
            this.MouseLeave                           += TextEditorMouseLeave;
            this.TextArea.TextView.MouseDown          += TextViewMouseDown;
            this.TextArea.Caret.PositionChanged       += HighlightBrackets;
            this.TextArea.TextView.VisualLinesChanged += CodeEditorView_VisualLinesChanged;

            SetupTabSnippetHandler();
        }