【问题标题】:Recommendation for 3rd party editing/syntax highlighting control - WinForms推荐第 3 方编辑/语法高亮控件 - WinForms
【发布时间】:2010-09-07 16:39:27
【问题描述】:

我正在寻找一个支持语法高亮、代码折叠等的优质 WinForms 组件。关键标准是:

  1. 稳定性
  2. 价值(价格)
  3. 能够轻松自定义语法以突出显示
  4. 重量轻

【问题讨论】:

    标签: .net winforms components


    【解决方案1】:

    ICSharpCode.TextEditor 是免费且相当稳定的。
    至于商业解决方案,Actipro 的SyntaxEditor 可能是最好的选择

    【讨论】:

    • SnippetCompiler sliver.com/dotnet/SnippetCompiler 也使用 ActiPro 作为其编辑器。
    • 顺便说一句,如果有人想知道,ActiPro 不支持客户端配置文件。
    【解决方案2】:

    试试ScintillaNET,它是一个围绕优秀Scintilla 控件的.NET WinForms 包装器。 Scintilla 本身是一个免费的源代码编辑器组件,它非常可定制,并具有您要求的所有功能。截图见here

    【讨论】:

    • ScintillaNET 的唯一问题是您将拥有更多非托管依赖项来拉入 Scintilla。
    • 对 ScintillaNET 的一点更新 - 直到现在 (9/2011) 绑定还不完整,并且有一些很难找到的错误。例如,如果您选择一整行,第一个字符会突出显示但不在选择中 - 现在我正在寻找 ScintillaNet 的替代品...
    【解决方案3】:

    与 Scintilla.Net 相比,增强 ICSharpCode.TextEditor 是微不足道的。 ICSharpCode.TextEditor 的另一个巨大好处是允许您自定义/构建自己的语法突出显示,例如:https://github.com/icsharpcode/SharpDevelop/wiki/Syntax-highlighting

    但是 ICSharpCode.TextEditor 不稳定,它充斥着 AccessViolations:https://www.google.com.au/search?q=icsharpcode.texteditor+accessviolationexception

    您可以通过下载直接查看这些 AccessViolations: http://www.codeproject.com/Articles/30936/Using-ICSharpCode-TextEditor

    GitHub 上的这个构建在 winforms 中表现更好,但在 VSTO 中它仍然尖叫 AccessViolations: https://github.com/KindDragon/ICSharpCode.TextEditor

    DigitalRune's version of the ICsharp.TextEditor

    我推荐最新的 WPF 实现:ICSharp.AvalonEdit

    如果您需要在 Winforms 中托管此 WPF 控件:

    public Form1()
    {
    InitializeComponent();
    ICSharpCode.AvalonEdit.TextEditor te = new ICSharpCode.AvalonEdit.TextEditor();
    ElementHost host = new ElementHost();
    host.Size = new Size(200, 100);
    host.Location = new Point(100, 100);
    host.Child = te;
    this.Controls.Add(host);
    }
    


    我遇到的一些商业的(注意我不隶属于这些公司): http://www.actiprosoftware.com/products/controls/windowsforms/syntaxeditor http://www.qwhale.net/products/editor.htm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多