public ByteGraphNode(ByteSource byteSource, int sourceIndex) { ByteSource = byteSource; SourceIndex = sourceIndex; Validate(); }
// public ByteGraphNode(ByteEntry byteData) // : this(byteData?.ParentByteSource, byteData?.ParentIndex ?? -1) // { // Validate(); // } internal void Validate() { if (ByteSource == null) { throw new InvalidDataException("No valid ByteSource set"); } if (!ByteSource.IsValidIndex(SourceIndex)) { throw new IndexOutOfRangeException("Invalid ByteSource index"); } }