コード例 #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));
            HighlightingOptions.ApplyToFolding(this, FetchCustomizations(language));
            this.TextArea.TextView.Redraw();             // manually redraw if default elements didn't change but customized highlightings did
        }
コード例 #2
0
        public void CopyEditorSettings(TextEditor source)
        {
            string language = source.SyntaxHighlighting != null ? source.SyntaxHighlighting.Name : null;

            editor.TextArea.TextView.LineTransformers.RemoveWhere(x => x is HighlightingColorizer);
            editor.TextArea.TextView.LineTransformers.Insert(0, new CustomizableHighlightingColorizer(source.SyntaxHighlighting.MainRuleSet, CustomizedHighlightingColor.FetchCustomizations(language)));
            CustomizableHighlightingColorizer.ApplyCustomizationsToDefaultElements(editor, CustomizedHighlightingColor.FetchCustomizations(language));
            HighlightingOptions.ApplyToRendering(editor, CustomizedHighlightingColor.FetchCustomizations(language));
            editor.TextArea.TextView.Redraw();             // manually redraw if default elements didn't change but customized highlightings did
        }
コード例 #3
0
        public HighlightingColor GetNamedColor(string name)
        {
            TextEditor editor = textEditor.GetService(typeof(TextEditor)) as TextEditor;

            if (editor == null)
            {
                return(null);
            }
            var highlighting = editor.SyntaxHighlighting;

            if (highlighting == null)
            {
                return(null);
            }
            return(CustomizableHighlightingColorizer.CustomizeColor(name, CustomizedHighlightingColor.FetchCustomizations(highlighting.Name)));
        }
コード例 #4
0
 public HighlightingColor GetNamedColor(string name)
 {
     return(CustomizableHighlightingColorizer.CustomizeColor(name, CustomizedHighlightingColor.FetchCustomizations(highlightingName)));
 }