Beispiel #1
0
        /// <summary>
        /// Поиск первого подузла по заданному аттрибуту
        /// </summary>
        /// <param name="_conds"></param>
        /// <returns></returns>
        public ExtXmlNode FindFirstSubElementByAttribute(string _name, string _value)
        {
            ExtXmlNode ret = null;

            Parallel.ForEach((this.InnerNode.ChildNodes).Cast <ExtXmlNode>(), parallel_options, (sub_el, loop_state) => {
                if (sub_el.InnerNode is XmlElement)
                {
                    if (((XmlElement)sub_el.InnerNode).HasAttribute(_name) == true)
                    {
                        if (sub_el.InnerNode.Attributes[_name].Value == _value)
                        {
                            ret = sub_el;
                            loop_state.Break();
                        }
                    }
                }
            });
            return(ret);
        }
Beispiel #2
0
 public void FillXmlElements(ExtXmlNode elem)
 {
     Parallel.ForEach(elem.InnerNode.ChildNodes.Cast <XmlNode>(), parallel_options, (el, loop_state) => {
         ExtXmlNode ext_el = new ExtXmlNode(el);
         if (ext_el != null)
         {
             if (!(ext_el.InnerNode is XmlText) &&
                 !(ext_el.InnerNode is XmlDeclaration) &&
                 !(ext_el.InnerNode is XmlWhitespace) &&
                 !(ext_el.InnerNode is XmlSignificantWhitespace))
             {
                 lock (XmlElements) {
                     XmlElements.Add((XmlElement)ext_el.InnerNode);
                 }
                 FillXmlElements(ext_el);
             }
         }
     });
 }
Beispiel #3
0
        public void FillXmlElements(XmlDocument doc)
        {
            XmlElements.Clear();
            XmlElements.Add(doc.DocumentElement);
            Parallel.ForEach(doc.DocumentElement.ChildNodes.Cast <XmlNode>(), parallel_options, (el, loop_state) => {
                if (!(el is XmlDeclaration) && !(el is XmlSignificantWhitespace))
                {
                    ExtXmlNode ext_el = new ExtXmlNode(el);
                    if (ext_el != null)
                    {
                        lock ( XmlElements ) {
                            XmlElements.Add((XmlElement)ext_el.InnerNode);
                        }
                        FillXmlElements(ext_el);
                    }
                }
            });

            XmlElements.Sort(_SortFunc);
        }
Beispiel #4
0
 public void FillXmlElements( ExtXmlNode elem )
 {
     Parallel.ForEach( elem.InnerNode.ChildNodes.Cast<XmlNode>(), parallel_options, (el, loop_state) => {
                      	ExtXmlNode ext_el =  new ExtXmlNode(el);
                      	if ( ext_el != null ) {
                      		if ( !(ext_el.InnerNode is XmlText)
                      		    &&  !(ext_el.InnerNode is XmlDeclaration)
                      		    &&  !(ext_el.InnerNode is XmlWhitespace)
                      		    &&  !(ext_el.InnerNode is XmlSignificantWhitespace) ) {
                      			lock (XmlElements) {
                      				XmlElements.Add((XmlElement)ext_el.InnerNode);
                      			}
                      			FillXmlElements(ext_el);
                      		}
                      	}
                      } );
 }
Beispiel #5
0
        public void FillXmlElements( XmlDocument doc )
        {
            XmlElements.Clear();
            XmlElements.Add(doc.DocumentElement);
            Parallel.ForEach( doc.DocumentElement.ChildNodes.Cast<XmlNode>(), parallel_options, (el, loop_state) => {
                             	if ( ! (el is XmlDeclaration) && !(el is XmlSignificantWhitespace) ) {
                             		ExtXmlNode ext_el =  new ExtXmlNode(el);
                             		if ( ext_el != null ) {
                             			lock ( XmlElements ) {
                             				XmlElements.Add((XmlElement)ext_el.InnerNode);
                             			}
                             			FillXmlElements(ext_el);
                             		}
                             	}
                             });

            XmlElements.Sort(_SortFunc);
        }