我已经将ICSharpCode.TextEditor集成到VB.NET中,它运行得很流畅,没有错误。但是,我在属性窗口中找不到启用或选择语法突出显示功能以及智能感知的属性。我没有任何使用ICSTE的经验,所以请帮助我。谢谢你。
发布于 2009-07-16 14:27:28
以下是我的项目中的代码
//Initialize HM
HighlightingManager.Manager.AddSyntaxModeFileProvider(new FileSyntaxModeProvider(AppDomain.CurrentDomain.BaseDirectory));
//Setup current Highlighter
IHighlightingStrategy highlighter = HighlightingManager.Manager.FindHighlighter("SQL");
txtQuery.Document.HighlightingStrategy = highlighter;确保AppDomain.CurrentDomain.BaseDirectory中存在文件SQL.xshd
至于entellisense,您应该主要使用以下代码自己实现它
private void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char ch)
{
try
{
codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(
this,
codeEditorControl,
"<code>",
completionDataProvider,
ch);
if (codeCompletionWindow != null)
{
codeCompletionWindow.Closed += delegate
{
_blockKeys = false;
};
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}发布于 2014-08-17 15:41:22
在github上查看这个项目:ICSharpCode.TextEditorEx和nuget:ICSharpCode.TextEditorEx
此版本公开了一个属性SyntaxHighlighting,您可以在设计器模式下使用该属性来设置语法突出显示。
https://stackoverflow.com/questions/1054596
复制相似问题