Ejemplo n.º 1
0
        public static void XmlDeserializeChildElements(XmlReader reader, ReadChildElementHandler readElements, params object[] args)
        {
            int    startDepth = reader.Depth;
            string startName  = reader.Name;
            bool   isContinue = reader.Read();

            while (isContinue)
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    readElements(reader, args);
                }
                else if (((reader.NodeType == XmlNodeType.EndElement) && (reader.Depth == startDepth)) && (reader.Name == startName))
                {
                    reader.Read();
                    isContinue = false;
                }
                else
                {
                    isContinue = reader.Read();
                }
            }
        }
Ejemplo n.º 2
0
 public static void XmlDeserializeChildElements(XmlReader reader, ReadChildElementHandler readElements, params object[] args)
 {
     int startDepth = reader.Depth;
     string startName = reader.Name;
     bool isContinue = reader.Read();
     while (isContinue)
     {
         if (reader.NodeType == XmlNodeType.Element)
         {
             readElements(reader, args);
         }
         else if (((reader.NodeType == XmlNodeType.EndElement) && (reader.Depth == startDepth)) && (reader.Name == startName))
         {
             reader.Read();
             isContinue = false;
         }
         else
         {
             isContinue = reader.Read();
         }
     }
 }