1,文字高亮背景变色

  安装vs2012 sdk

  创建c#=>扩展性=>edit Text Adornment 项目类型

  则可以设置文字背景颜色

  项目自动创建类

[Export(typeof(IWpfTextViewCreationListener))]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Document)]
internal sealed class MyTextAdornmentFactory : IWpfTextViewCreationListener
实现IWpfTextViewCreationListener接口的
void TextViewCreated(IWpfTextView textView)方法
中创建一个自定义实例 new MyTextAdornment(textView);
实例化中_view.LayoutChanged += OnLayoutChanged;事件触发
_view.TextSnapshot[i] == '变色字符'
...

posted on 2012-10-23 22:57  LcKey  阅读(355)  评论(0编辑  收藏  举报