예제 #1
0
        public ByteGraphNode(ByteSource byteSource, int sourceIndex)
        {
            ByteSource  = byteSource;
            SourceIndex = sourceIndex;

            Validate();
        }
예제 #2
0
        // 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");
            }
        }