WPF 的语法荧光笔

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/454872/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:58:07  来源:igfitidea点击:

Syntax Highlighter for WPF

wpfsyntaxsyntax-highlighting

提问by Ray Booysen

I'm currently looking for a Syntax highlighter for a WPF application. A textbox will be available for the user to type into which would hopefully recognise code and highlight syntax accordingly.

我目前正在为 WPF 应用程序寻找语法荧光笔。用户可以输入一个文本框,希望能够识别代码并相应地突出显示语法。

I would like to support C# initialy and other languages later.

我想稍后支持 C# initialy 和其他语言。

Duplicate of Question 394751

问题394751 的副本

回答by Stefano Driussi

Some time ago i've found thisblog post with a tutorial on how to create a custom syntax highlight control from a RichTextBox. Maybe it could be usefull for you too.

前段时间我发现了这篇博客文章,里面有一个关于如何从 RichTextBox 创建自定义语法高亮控件的教程。也许它对你也有用。

回答by Andrey Shchekin

If you do not mind having no documentation whatsoever, AvalonEditis a good choice. I am currently using for a project, and it is a great tool. I have not encountered a single bug even in complex scenarios.

如果您不介意没有任何文档,AvalonEdit是一个不错的选择。我目前正在用于一个项目,它是一个很棒的工具。即使在复杂的场景中,我也没有遇到过一个错误。

回答by aku

I was looking for the same thing without success. Only solution I found is Actipro's Syntax Highlighterfor WinForms that can be hosted in WPF application. AFAIK Actipro is working on WPF version but I don't know if it ready or not

我一直在寻找同样的东西,但没有成功。我找到的唯一解决方案是 Actipro 的用于 WinForms的Syntax Highlighter,它可以托管在 WPF 应用程序中。AFAIK Actipro 正在开发 WPF 版本,但我不知道它是否准备就绪