public HeaderItems <T> GetChildlessChildren() { HeaderItems <T> childless = new HeaderItems <T>(); AddChildlessChildren(childless); return(childless); }
public void AddChild(HeaderItem <T> header) { if (null == Children) { Children = new HeaderItems <T>(); } header.Parent = this; Children.Add(header); }
void AddChildlessChildren(HeaderItems <T> childless) { if (!HasChildren) { childless.Add(this); } else { foreach (HeaderItem <T> item in Children) { item.AddChildlessChildren(childless); } } }