示例#1
0
        /// <summary>
        /// Get the first the <see cref="XmlElement"/> with the corresponding name and and with the corresponding value attribute of the <see cref="XmlNodeList"/>
        /// </summary>
        /// <param name="nodeList"></param>
        /// <param name="name"></param>
        /// <param name="attribute"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        static public XmlElement FirstElement(this XmlNodeList nodeList, string name, string attribute, string value)
        {
            foreach (XmlElement item in nodeList.EnumerableElement(name, attribute, value))
            {
                return(item);
            }

            return(null);
        }
示例#2
0
        /// <summary>
        /// Get the first <see cref="XmlElement"/> of the <see cref="XmlNodeList"/>
        /// </summary>
        /// <param name="nodeList"></param>
        static public XmlElement FirstElement(this XmlNodeList nodeList)
        {
            foreach (XmlElement item in nodeList.EnumerableElement())
            {
                return(item);
            }

            return(null);
        }
示例#3
0
 /// <summary>
 /// Enumerate the <see cref="XmlElement"/> with the corresponding name and containing the attribute in the <see cref="XmlNodeList"/>
 /// </summary>
 /// <param name="nodeList"></param>
 /// <param name="name"></param>
 /// <param name="attribute"></param>
 /// <returns></returns>
 static public IEnumerable <XmlElement> EnumerableElement(this XmlNodeList nodeList, string name, string attribute)
 {
     foreach (XmlElement item in nodeList.EnumerableElement(name))
     {
         if (item.Name == name && item.HasAttribute(attribute))
         {
             yield return(item);
         }
     }
 }
示例#4
0
 /// <summary>
 /// Enumerate the <see cref="XmlElement"/> in the <see cref="XmlNodeList"/> in reverse ordre
 /// </summary>
 /// <param name="nodeList"></param>
 /// <returns></returns>
 static IEnumerable <XmlElement> EnumerableElementReverse(this XmlNodeList nodeList)
 {
     return(nodeList.EnumerableElement().Reverse());
 }
示例#5
0
 /// <summary>
 /// Enumerate the <see cref="XmlElement"/> with the corresponding name and and with the corresponding value attribute in the <see cref="XmlNodeList"/>
 /// </summary>
 /// <param name="nodeList"></param>
 /// <param name="name"></param>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 static public XmlElement[] GetElements(this XmlNodeList nodeList, string name, string attribute, string value)
 {
     return(nodeList.EnumerableElement(name, attribute, value).ToArray());
 }
示例#6
0
 /// <summary>
 /// Enumerate the <see cref="XmlElement"/> in the <see cref="XmlNodeList"/>
 /// </summary>
 /// <param name="nodeList"></param>
 static public XmlElement[] GetElements(this XmlNodeList nodeList)
 {
     return(nodeList.EnumerableElement().ToArray());
 }