Silverlight XML 编辑器/语法突出显示

发布于 2024-07-10 18:59:27 字数 572 浏览 4 评论 0 原文

我正在寻找一个提供XML 语法突出显示Silverlight 文本编辑器控件。 我在 WinformsWPF 中找到了一些答案,例如 Stackoverflow 上,但我没有设法将它们转换为 Silverlight。 事实上,Silverlight 缺少 System.Drawing 可能是一个大问题。

我为 Silverlight 找到的唯一文本编辑器是 Codeplex 上的 RichTextEdit,但我不认为它是一个实时语法突出显示的合适基础。

有谁听说过这样的控件,或者可以提供有关如何构建控件的提示吗? 非常感谢,

罗曼

I am looking for a Silverlight text editor control that provides XML syntax highlighting. I found a few answers in Winforms or WPF, like here on Stackoverflow, but I didn't manage to convert them to Silverlight. The fact that Silverlight is missing System.Drawing is probably a big problem.

The only text editor I found for Silverlight is RichTextEdit on Codeplex, but I don't think it is a suitable base for real-time syntax highlighting.

Has anyone heard of such a control, or can provide hints on how to build one?
Many thanks,

Romain

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

不羁少年 2024-07-17 18:59:27

我终于找到了我正在寻找的控件!
SL2TextBoxWsSynParser

编辑:此控件似乎不再更新,而是一个新的语法高亮控件已浮出水面:

它可用 此处,并在 CoderProof 网站上使用。

I finally found that control I was looking for!
SL2TextBoxWsSynParser

EDIT: This control does not seem to be updated anymore, but a new syntax-highlighting control has surfaced:

It is available here, and used on the CoderProof website.

那片花海 2024-07-17 18:59:27

Actipro Software 具有适用于 Winforms、WPF 和 Silverlight 的语法突出显示组件:

http://www.actiprosoftware.com/

Actipro Software has a syntax highlighter component for Winforms, WPF, and Silverlight:

http://www.actiprosoftware.com/

樱桃奶球 2024-07-17 18:59:27

我认为这是一个有趣的问题,但你没有答案。

我不知道现有的控件。

我已经构建了一个控件来编辑 XHTML,但它也使用 System.Drawing 而不是 WPF(因此不适用于 Silverlight)。

WPF 可能至少与 System.Drawing 一样强大,但我不知道。

关于我如何构建它的提示:

  • 定义 DOM(普通的 System.Xml.XmlDocument 可能适合您)
  • 解析文档以实例化 DOM
  • 定义用户控件(带有滚动条)
  • 将 DOM 实例传递给用户控件
  • 在控件的 ' Paint' 方法,绘制 DOM 的可见部分
  • 实现对鼠标和按键的支持

如果您确实需要有关如何构建一个的提示,请询问更具体的问题。

I thought this was an interesting question, but you've had no answer.

I don't know of an existing control.

I've built a control to edit XHTML, but it too uses System.Drawing rather than WPF (and therefore isn't for Silverlight).

WPF is probably at least as capable as System.Drawing, but I don't know it.

Hints on how I built it:

  • Define a DOM (a vanilla System.Xml.XmlDocument might suit you)
  • Parse a document to instantiate a DOM
  • Define a user control (with scroll bars)
  • Pass the DOM instance to the user control
  • In the control's 'paint' method, paint the visible fraction of the DOM
  • Implement support for mouse and key presses

If you really want hints on how to build one, ask something more specific.

月下伊人醉 2024-07-17 18:59:27

嗨& 感谢您的回答!

不幸的是,虽然 WPF 具有绘图功能,但 Silverlight 运行一组非常有限的 CLR。 绘制用户控件看起来是一项相当困难的任务。

不过,之前已经使用 Silverlight 富文本编辑器完成了这项工作。 我将看看是否能够使用类似的技术来呈现 XML 文档。

但有一个问题:当用户进行更改时,用户控件是否足够快地渲染 DOM?

Hi & thanks for your answer!

Unfortunately, while WPF has drawing capabilities, Silverlight runs a very restricted set of the CLR. Painting the user control looks like quite a difficult task.

However it has been done before with this Rich text editor for Silverlight. I will see if I manage to use similar techniques to render the XML document.

One question though: is the user control fast enough to render the DOM on the fly, as the user makes changes?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文