Exemplo n.º 1
0
        public static void StyleNeeded(Scintilla scintilla, Range range)
        {
            // Create an instance of our lexer and bada-bing the line!
            IniLexer lexer = new IniLexer(scintilla, range.Start, range.StartingLine.Length);

            lexer.Style();
        }
Exemplo n.º 2
0
        //设置语言
        public void SetLanguage(string language)
        {
            if ("ini".Equals(language, StringComparison.OrdinalIgnoreCase))
            {
                // Reset/set all styles and prepare _scintilla for custom lexing
                ActiveDocument.IniLexer = true;
                IniLexer.Init(ActiveDocument.Scintilla);
            }
            else
            {
                // Use a built-in lexer and configuration
                ActiveDocument.IniLexer = false;
                ActiveDocument.Scintilla.ConfigurationManager.Language = language;

                // Smart indenting...
                if ("cs".Equals(language, StringComparison.OrdinalIgnoreCase))
                {
                    ActiveDocument.Scintilla.Indentation.SmartIndentType = ScintillaNET.SmartIndent.CPP;
                }
                else
                {
                    ActiveDocument.Scintilla.Indentation.SmartIndentType = ScintillaNET.SmartIndent.None;
                }
            }
        }
Exemplo n.º 3
0
 public static void StyleNeeded(Scintilla scintilla, Range range)
 {
     // Create an instance of our lexer and bada-bing the line!
     IniLexer lexer = new IniLexer(scintilla, range.Start, range.StartingLine.Length);
     lexer.Style();
 }