public DTASegment FindFirstSegment(string tag) { DTASegment ret = null; if (Name.EqualsEx(tag)) { ret = this; } else { Children.FirstOrDefault(x => (ret = x.FindFirstSegment(tag)) != null); } return(ret); }
public DTASegment(DTASegment parent, string text) : this(parent) { var first = text.IndexOf(' '); if (first != -1) { Name = text.SubstringEx(0, first).Trim(); Value = text.SubstringEx(first + 1).Trim(); } else { Name = text.Trim(); Value = text.Trim(); } }
public DTASegment(DTASegment parent) { Parent = parent; Children = new List <DTASegment>(); }