Ejemplo n.º 1
0
 private void EditorView_StyleNeeded(object sender, StyleNeededEventArgs e)
 {
     if (iscustomelexerinit)
     {
         LexerInitializer.StyleNeeded((Scintilla)sender, e.Range);
     }
 }
Ejemplo 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();
        }
Ejemplo 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);
        }
Ejemplo 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();
 }