高亮显示代码编辑器控件【转】

http://www.cnblogs.com/wudingfeng/archive/2009/09/11/1564903.html

 https://github.com/icsharpcode/SharpDevelop

可以实现像Visual Studio的窗口停靠、拖拽等功能。

Mono.Cecil.dll这个文件是用来反编译.NET生产的IL的。

icsharpcode.texteditor.dll语法高亮控件ICSharpCode.TextEditor来自开源项目SharpDevelop,C#下的文本编辑器,支持各种语法彩显,行号,函数的折叠等,功能强大-a text editor, support for various grammatical Color, line, function folding, powerful。

ICSharpCode.Core.WinForms.dll和ICSharpCode.Core.dll这两个也来自开源项目SharpDevelop。主要是用于插件开发相关应用。

Aga.Controls.dll,C#下,在treeview上附加多个控件,如combobox等,使的treeview能加载多种控件,使界面更加人性化.

ICSharpCode.NRefactory.dll,与codedom有关的,如果你想开发类似VS的IDE环境,首选就是这个。

SharpDevelop (#develop)有很多“副产品”,其中最出名的应算SharpZipLib (#ziplib),纯C#的ZIP类库,而在SharpDevelop (#develop)中,“隐藏”了很多优秀的类库,其中ICSharpCode.TextEditor是表表者。

ICSharpCode.TextEditor源代码隐匿在SharpDevelopsrcLibrariesICSharpCode.TextEditor中,可以利用SharpDevelop (#develop)打开ICSharpCode.TextEditor.cmbx,也可以看看其例子(SharpDevelopsamplesSharpPad中)SharpPad.cmbx。

先说说它的用法:

1:将ICSharpCode.TextEditor.dll添加到工具箱中,然后拖到界面上。

2:设置如下属性(例):

复制代码
textEditorControl1.ShowEOLMarkers = false;
textEditorControl1.ShowHRuler 
= false;
textEditorControl1.ShowInvalidLines 
= false;
textEditorControl1.ShowMatchingBracket 
= true;
textEditorControl1.ShowSpaces 
= false;
textEditorControl1.ShowTabs 
= false;
textEditorControl1.ShowVRuler 
= false;
textEditorControl1.AllowCaretBeyondEOL 
= false;
textEditorControl1.Document.HighlightingStrategy 
= HighlightingStrategyFactory.CreateHighlightingStrategy("HTML");
textEditorControl1.Encoding 
= Encoding.GetEncoding("GB2312");
复制代码
3:指定内容文本
textEditorControl1.Text = "Hello World!"

 

再来说说他的扩展:

 官方原版的是不支持T-SQL语法的,我们让他支持T-SQL语法

下载http://files.cnblogs.com/wudingfeng/ICSharpCode.TextEditor_V3.0.rar

里面有一个TSQL-Mode.xshd文件,作为资源添加到项目中,然后修改SyntaxModes.xml文件,添加一行

<Mode file = "TSQL-Mode.xshd"
        name 
= "TSQL"
        extensions 
= ".sql"/>

然后再编译整个项目即可生成支持T-SQL的ICSharpCode.TextEditor.

 

下载最新SharpDevelop

 http://www.icsharpcode.com/OpenSource/SD/Download/

原文地址:https://www.cnblogs.com/fx2008/p/3438104.html