internal void OnLayoutChanged(object sender, TextViewLayoutChangedEventArgs e)
 {
     foreach (ITextViewLine line in e.NewOrReformattedLines)
     {
         var text = VisualCharArray.FromTextView(view, line);
         foreach (var word in keywords)
         {
             text.DrawAtWord(word, Draw, layer, view, view.TextViewLines, brush, pen);
         }
     }
 }
Exemplo n.º 2
0
        public static VisualCharArray FromTextView(IWpfTextView view, ITextViewLine line)
        {
            VisualCharArray arr = new VisualCharArray();

            for (int i = line.Start; i < line.End; i++)
            {
                arr.Add(new VisualChar(view.TextSnapshot[i], i));
            }

            return(arr);
        }