Ejemplo n.º 1
0
        public override ComplexData?GetStructure(HexPosition position)
        {
            if (!Span.Span.Contains(position))
            {
                return(null);
            }

            if (HeaderSpan.Contains(position))
            {
                return(Header);
            }

            var mdTable = GetTable(position);

            if (mdTable is not null)
            {
                return(GetRecord(mdTable, position));
            }

            return(null);
        }
        public override void FillYamlString(StringBuilder builder, int intendation)
        {
            base.FillYamlString(builder, intendation);

            var intended = IntendedString.From(intendation);

            builder.Append(intended).Append("headerSpan: ").AppendLine(HeaderSpan.ToYamlString());
            builder.Append(intended).Append("footerSpan: ").AppendLine(FooterSpan.ToYamlString());

            if (Children.Any())
            {
                builder.Append(intended).AppendLine("children: ");

                foreach (var child in Children)
                {
                    builder.Append(intended).AppendLine("- ");
                    child.FillYamlString(builder, intendation + 3);
                    builder.AppendLine();
                }
            }
        }