【发布时间】:2013-01-13 05:23:19
【问题描述】:
我将 ICSharpCode AvalonEdit 源代码编辑 WPF 控件托管到我的 Windows 窗体 C# 应用程序中。我知道下面的代码会加载一个语法高亮定义:
ICSharpCode.AvalonEdit.TextEditor MyEditor = new ICSharpCode.AvalonEdit.TextEditor();
MyEditor.ShowLineNumbers = true;
Stream xshd_stream = File.OpenRead("C:\\Syntax Highlighting\\php.xsdh");
XmlTextReader xshd_reader = new XmlTextReader(xshd_stream);
// Apply the new syntax highlighting definition.
MyEditor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.HighlightingLoader.Load(
xshd_reader, ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance
);
xshd_reader.Close();
xshd_stream.Close();
但是,如果在我已经设置了语法高亮定义之后,我不想要任何语法高亮,我只想让它显示为纯文本怎么办?如何禁用 AvalonEdit 控件中的语法高亮显示?
【问题讨论】:
标签: c# wpf winforms avalonedit icsharpcode