protected override SourcePosition BuildSourcePosition()
 {
     return(SourcePosition.Create(Token.Index, Token.Index + Token.Value.Length - 1));
 }
Example #2
0
 public bool Contains(SourcePosition sourcePosition)
 {
     return(IndexStart <= sourcePosition.IndexStart && IndexEnd >= sourcePosition.IndexEnd);
 }
Example #3
0
 public bool Equals(SourcePosition other)
 {
     return(IndexStart == other.IndexStart && IndexEnd == other.IndexEnd);
 }
Example #4
0
        private static void DrawRectangle(TextView textView, DrawingContext drawingContext, SourcePosition sourceSegment, Brush brush, Pen pen)
        {
            var segment = new ICSharpCode.AvalonEdit.Document.TextSegment {
                StartOffset = sourceSegment.IndexStart, EndOffset = sourceSegment.IndexEnd
            };

            foreach (var rectangle in BackgroundGeometryBuilder.GetRectsForSegment(textView, segment))
            {
                drawingContext.DrawRectangle(brush, pen, rectangle);
            }
        }