Wpf 如何在VS2010文本装饰扩展中更改文本的颜色和权重?

Wpf 如何在VS2010文本装饰扩展中更改文本的颜色和权重?,wpf,vs-extensibility,Wpf,Vs Extensibility,在我的TextAdorment1类中,我定义了以下内容: ' <summary>' ' On layout change add the adornment to any reformatted lines' ' </summary>' Private Sub OnLayoutChanged(ByVal sender As Object, ByVal e As TextViewLayoutChangedEventArgs) Handles _view.La

在我的TextAdorment1类中,我定义了以下内容:

  ' <summary>'
  ' On layout change add the adornment to any reformatted lines'
  ' </summary>'
  Private Sub OnLayoutChanged(ByVal sender As Object, ByVal e As TextViewLayoutChangedEventArgs) Handles _view.LayoutChanged
    For Each line In e.NewOrReformattedLines
      Me.CreateVisuals(line)
    Next line
  End Sub

ITextViewLine的一个实例被传递给我的CreateVisuals方法。如何更改该行文本的颜色,以及如何将其加粗?我看到了很多通过绘制图像来突出显示文本的例子,但到目前为止,还没有改变实际文本的格式。我怎样才能做到这一点呢?

我不认为这可以通过AFAIK的装饰来实现,它们只是向窗口添加元素,而不是改变现有的元素

我建议您查看编辑器分类器,它将允许您更改文本格式VSSDK包含一个用于分类器的良好项目模板