예제 #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();
        }
예제 #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;
                }
            }
        }
예제 #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();
 }