protected override SourcePosition BuildSourcePosition() { return(SourcePosition.Create(Token.Index, Token.Index + Token.Value.Length - 1)); }
public bool Contains(SourcePosition sourcePosition) { return(IndexStart <= sourcePosition.IndexStart && IndexEnd >= sourcePosition.IndexEnd); }
public bool Equals(SourcePosition other) { return(IndexStart == other.IndexStart && IndexEnd == other.IndexEnd); }
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); } }