Exemple #1
0
        public static Segmento FromXml(XmlNode node)
        {
            double tmp;
            var    segmento = new Segmento
            {
                Nombre      = HttpUtility.UrlDecode(node.Attributes["nombreLargo"].Value, Encoding.GetEncoding("ISO-8859-1")),
                NombreMapa  = HttpUtility.UrlDecode(node.Attributes["nombreMapa"].Value, Encoding.GetEncoding("ISO-8859-1")),
                Distancia   = double.TryParse("0" + node.Attributes["distancia"].Value, NumberStyles.Any, CultureInfo.InvariantCulture, out tmp)?tmp: 0,
                IdMapa      = Convert.ToInt16(node.Attributes["idMapa"].Value),
                IdPoligonal = Convert.ToInt32(node.Attributes["idPoligonal"].Value),
                IdEsquina   = Convert.ToInt32(node.Attributes["idEsquina"].Value),
                Altura      = Convert.ToInt32(node.Attributes["altura"].Value)
            };

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.Name != "VERTICE")
                {
                    continue;
                }
                segmento.Vertices.Add(Vertice.FromXml(childNode));
            }

            return(segmento);
        }
Exemple #2
0
 internal override void FromXml(XmlNode node)
 {
     if (node == null)
     {
         return;
     }
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.Name != "SEGMENTO")
         {
             continue;
         }
         Segmentos.Add(Segmento.FromXml(childNode));
     }
 }
Exemple #3
0
        public static Micro FromXml(XmlNode node)
        {
            var micro = new Micro
            {
                Nombre         = HttpUtility.UrlDecode(node.Attributes["name"].Value, Encoding.GetEncoding("ISO-8859-1")),
                EsquinaInicial = HttpUtility.UrlDecode(node.Attributes["esqI"].Value, Encoding.GetEncoding("ISO-8859-1")),
                EsquinaFinal   = HttpUtility.UrlDecode(node.Attributes["esqF"].Value, Encoding.GetEncoding("ISO-8859-1"))
            };

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.Name != "SEGMENTO")
                {
                    continue;
                }
                micro.Segmentos.Add(Segmento.FromXml(childNode));
            }
            return(micro);
        }