在我的 winforms 应用程序中,我将创建一个自定义语法突出显示,所以我制作了这个 xml:
<ScintillaNET>
<Language Name="default">
<Styles>
<Style Name="Default" FontName="Consolas"/>
</Styles>
</Language>
<Language Name="customSql">
<Lexer LineCommentPrefix="--" StreamCommentPrefix="/* " StreamCommentSuffix=" /*" LexerName="customSql" >
<Keywords List="0">
Data Source Initial Catalog User Id Password Database Server Trusted_Connection
Integrated Security Network Library User Instance AttachDbFilename Failover Partner
Asynchronous Processing Uid Pwd Provider SSPI
</Keywords>
</Lexer>
<Styles>
<Sytle Name="CHARACTER" ForeColor="Black"/>
<Sytle Name="NUMBER" ForeColor="Red" />
</Styles>
</Language>
</ScintillaNET>
对我来说看起来不错。在我的应用程序中,我将语言和其他属性设置为:
myC.ConfigurationManager.Language = "customSql";
myC.ConfigurationManager.CustomLocation = Global.Path + @"Resources\ScintillaNET.xml";
myC.ConfigurationManager.Configure();
我不明白为什么这仍然不起作用。我也不例外,只是文字保持黑色。有什么提示吗?