indice.Edi.Serialization.EdiStructure.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString() {
            var text = new System.Text.StringBuilder();
            text.Append($"{Container}");
            switch (Container) {
                case EdiStructureType.Element:
                    text.Append($" {Descriptor.Attributes.OfType<EdiPathAttribute>().FirstOrDefault()?.PathInternal.ToString("e")}"); // element
                    break;
                case EdiStructureType.SegmentGroup:
                    text.Append($" {GroupStart.ToString("s")}"); // only segment
                    break;
                default:
                    text.Append($" {Descriptor.Attributes.OfType<EdiPathAttribute>().FirstOrDefault()?.PathInternal.ToString("s")}"); // the rest
                    break;
            }
            if (Index > 0)
                text.Append($"[{Index + 1}]");
            return text.ToString();
        }