示例#1
0
        /// <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);
        }
示例#2
0
 public Section()
 {
     elements = new ElementCollection();
 }