/// <summary> /// Constructor /// </summary> /// <param name="index">Cell index</param> /// <param name="groupIndex">Group index</param> /// <param name="bufferSpan">Buffer span or the default value if there's no data</param> /// <param name="textSpan">Span of the text. This span doesn't include any whitespace before and after the text.</param> /// <param name="cellSpan">Span of the cell, some of the span could be whitespace</param> /// <param name="separatorSpan">Span of the cell separator</param> /// <param name="fullSpan">Includes the whole cell and separator span</param> public HexCell(int index, int groupIndex, HexBufferSpan bufferSpan, VST.Span textSpan, VST.Span cellSpan, VST.Span separatorSpan, VST.Span fullSpan) { if (index < 0) { throw new ArgumentOutOfRangeException(nameof(index)); } if (groupIndex < 0 || groupIndex > 1) { throw new ArgumentOutOfRangeException(nameof(groupIndex)); } if (cellSpan.Length == 0) { throw new ArgumentOutOfRangeException(nameof(cellSpan)); } if (!fullSpan.Contains(cellSpan)) { throw new ArgumentOutOfRangeException(nameof(cellSpan)); } HasData = !bufferSpan.IsDefault; Index = index; GroupIndex = groupIndex; BufferSpan = bufferSpan; TextSpan = textSpan; CellSpan = cellSpan; SeparatorSpan = separatorSpan; FullSpan = fullSpan; }
/// <summary> /// Constructor /// </summary> /// <param name="groupIndex">Group index</param> /// <param name="fullSpan">Full span including a possible separator at the end of the span</param> /// <param name="span">Span without the separator at the end of the span</param> public HexGroupInformation(int groupIndex, VST.Span fullSpan, VST.Span span) { if (groupIndex < 0 || groupIndex > 1) { throw new ArgumentOutOfRangeException(nameof(groupIndex)); } if (!fullSpan.Contains(span)) { throw new ArgumentOutOfRangeException(nameof(span)); } GroupIndex = groupIndex; FullSpan = fullSpan; Span = span; }