Esempio n. 1
0
 private void EditorView_StyleNeeded(object sender, StyleNeededEventArgs e)
 {
     if (iscustomelexerinit)
     {
         LexerInitializer.StyleNeeded((Scintilla)sender, e.Range);
     }
 }
Esempio n. 2
0
        public static void StyleNeeded(Scintilla scintilla, Range range)
        {
            // Create an instance of our lexer and bada-bing the line!
            LexerInitializer lexer = new LexerInitializer(scintilla, range.Start, range.StartingLine.Length);

            lexer.Style();
        }
Esempio n. 3
0
        public void SetLanguage(string language)
        {
            if ("ini".Equals(language, StringComparison.OrdinalIgnoreCase))
            {
                // Reset/set all styles and prepare scintilla for custom lexing
                this.IsCustomeLexerInit = true;
                LexerInitializer.Init(this.EditorView);
            }
            else
            {
                // Use a built-in lexer and configuration
                this.IsCustomeLexerInit = false;
                this.EditorView.ConfigurationManager.Language = language;

                // Smart indenting...
                if ("cs".Equals(language, StringComparison.OrdinalIgnoreCase))
                {
                    this.EditorView.Indentation.SmartIndentType = SmartIndent.CPP;
                }
                else
                {
                    this.EditorView.Indentation.SmartIndentType = SmartIndent.None;
                }
            }
            //apply userconfig
            LexerInitializer.ApplyUserStyle(EditorView, this.Userconfig);
        }
Esempio n. 4
0
 public static void StyleNeeded(Scintilla scintilla, Range range)
 {
     // Create an instance of our lexer and bada-bing the line!
     LexerInitializer lexer = new LexerInitializer(scintilla, range.Start, range.StartingLine.Length);
     lexer.Style();
 }