public PhysicalLine(HexFormattedLine[] lines) { if (lines == null) throw new ArgumentNullException(nameof(lines)); if (lines.Length == 0) throw new ArgumentException(); Lines = lines; IsLastLine = Lines[0].BufferLine.LineNumber + 1 == Lines[0].BufferLine.LineProvider.LineCount; }
public int IndexOf(HexFormattedLine line) => Array.IndexOf(Lines, line);
public LineInfo(HexFormattedLine line, double y) { Line = line; Y = y; }
PhysicalLine GetPhysicalLine(HexFormattedLine line) => toPhysicalLine[line];
HexFormattedLine GetLineAfter(HexFormattedLine line) { var physLine = GetPhysicalLine(line); int index = physLine.IndexOf(line); if (index < 0) throw new InvalidOperationException(); if (index + 1 < physLine.Lines.Length) return physLine.Lines[index + 1]; if (physLine.IsLastLine) return null; physLine = GetPhysicalLine(physLine.BufferSpan.End); return physLine.Lines[0]; }
HexFormattedLine GetLineBefore(HexFormattedLine line) { var physLine = GetPhysicalLine(line); int index = physLine.IndexOf(line); if (index < 0) throw new InvalidOperationException(); if (index > 0) return physLine.Lines[index - 1]; if (physLine.BufferSpan.Start <= bufferLines.BufferSpan.Start) return null; physLine = GetPhysicalLine(physLine.BufferSpan.Start - 1); return physLine.Lines[physLine.Lines.Length - 1]; }
HexFormattedLine AddLineTransform(HexFormattedLine line, double yPosition, VSTE.ViewRelativePosition placement) { if (line != null) { var lineTransform = lineTransformProvider.GetLineTransform(line, yPosition, placement); if (lineTransform != line.LineTransform) { line.SetLineTransform(lineTransform); line.SetChange(VSTF.TextViewLineChange.NewOrReformatted); } } return line; }
public LineInfo(HexFormattedLine line) { Line = line; Visual = line.GetOrCreateVisual(); }