/// <summary> /// Gets all elements and sub-elements with the specified name. /// </summary> /// <param name="name"></param> /// <returns></returns> public ElementCollection GetElements(String name) { ElementCollection res = new ElementCollection(); foreach (IElement element in elements) { if (name == element.Name) { res.Add(element); } Section section = element.Value as Section; if (section != null) { res.AddRange(section.GetElements(name)); } } return(res); }
public Section() { elements = new ElementCollection(); }