public override void EnsureSpanVisible(HexBufferLine line, VST.Span span, VSTE.EnsureSpanVisibleOptions options) { if (line == null) throw new ArgumentNullException(nameof(line)); if (line.Buffer != hexView.Buffer) throw new ArgumentException(); EnsureSpanVisibleCore(new HexLineSpan(line, span), options); }
/// <summary> /// Constructor /// </summary> /// <param name="line">Line</param> /// <param name="textSpan">Text span</param> public HexLineSpan(HexBufferLine line, VST.Span textSpan) { if (line == null) throw new ArgumentNullException(nameof(line)); BufferSpan = line.BufferSpan; SelectionFlags = null; TextSpan = textSpan; }
/// <summary> /// Constructor /// </summary> /// <param name="line">Line</param> /// <param name="textSpan">Text span</param> public HexLineSpan(HexBufferLine line, VST.Span textSpan) { if (line == null) { throw new ArgumentNullException(nameof(line)); } BufferSpan = line.BufferSpan; SelectionFlags = null; TextSpan = textSpan; }
IEnumerable<KeyValuePair<LineElementKind, int>> GetColumnPositions(HexBufferLine line) { var columns = line.ColumnOrder.Where(a => line.IsColumnPresent(a)).ToArray(); for (int i = 1; i < columns.Length; i++) { Debug.Assert(i < 3); if (i >= 3) break; var colSpan1 = line.LineProvider.GetColumnSpan(columns[i - 1]); var colSpan2 = line.LineProvider.GetColumnSpan(columns[i]); Debug.Assert(colSpan1.End < colSpan2.Start); var kind = i == 1 ? LineElementKind.Column0 : LineElementKind.Column1; yield return new KeyValuePair<LineElementKind, int>(kind, colSpan1.End); } if (line.IsValuesColumnPresent) { var spanInfos = line.GetValuesSpans(line.BufferSpan, HexSpanSelectionFlags.Group0 | HexSpanSelectionFlags.Group1).ToArray(); for (int i = 1; i < spanInfos.Length; i++) { Debug.Assert(spanInfos[i - 1].TextSpan.End == spanInfos[i].TextSpan.Start); int linePosition = spanInfos[i - 1].TextSpan.End - 1; var kind = i % 2 == 1 ? LineElementKind.Group0 : LineElementKind.Group1; yield return new KeyValuePair<LineElementKind, int>(kind, linePosition); } } }