zoukankan      html  css  js  c++  java
  • ICSharpCode.TextEditor使用及扩展

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

    ICSharpCode.TextEditor源代码隐匿在\SharpDevelop\src\Libraries\ICSharpCode.TextEditor中,可以利用SharpDevelop (#develop)打开ICSharpCode.TextEditor.cmbx,也可以看看其例子(\SharpDevelop\samples\SharpPad中)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语法

    下载https://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/

  • 相关阅读:
    三维dem
    geoserver 通过代码实现发布地图服务
    restful发布服务
    php防攻击
    redis主从复制
    redis虚拟内存
    redis 持久化
    lamp源码安装
    mysql优化
    php匿名函数与闭包函数
  • 原文地址:https://www.cnblogs.com/wudingfeng/p/1564903.html
Copyright © 2011-2022 走看看