예제 #1
0
        public static IEnumerable <ISOGuidanceGroup> ReadXML(XmlNodeList nodes)
        {
            List <ISOGuidanceGroup> items = new List <ISOGuidanceGroup>();

            foreach (XmlNode node in nodes)
            {
                items.Add(ISOGuidanceGroup.ReadXML(node));
            }
            return(items);
        }
예제 #2
0
        public static ISOPartfield ReadXML(XmlNode node)
        {
            ISOPartfield field = new ISOPartfield();

            field.PartfieldID         = node.GetXmlNodeValue("@A");
            field.PartfieldCode       = node.GetXmlNodeValue("@B");
            field.PartfieldDesignator = node.GetXmlNodeValue("@C");
            field.PartfieldArea       = node.GetXmlNodeValueAsUInt("@D");
            field.CustomerIdRef       = node.GetXmlNodeValue("@E");
            field.FarmIdRef           = node.GetXmlNodeValue("@F");
            field.CropTypeIdRef       = node.GetXmlNodeValue("@G");
            field.CropVarietyIdRef    = node.GetXmlNodeValue("@H");
            field.FieldIdRef          = node.GetXmlNodeValue("@I");

            XmlNodeList plnNodes = node.SelectNodes("PLN");

            if (plnNodes != null)
            {
                field.Polygons.AddRange(ISOPolygon.ReadXML(plnNodes));
            }

            XmlNodeList lsgNodes = node.SelectNodes("LSG");

            if (lsgNodes != null)
            {
                field.LineStrings.AddRange(ISOLineString.ReadXML(lsgNodes));
            }

            XmlNodeList pntNodes = node.SelectNodes("PNT");

            if (pntNodes != null)
            {
                field.Points.AddRange(ISOPoint.ReadXML(pntNodes));
            }

            XmlNodeList ggpNodes = node.SelectNodes("GGP");

            if (ggpNodes != null)
            {
                field.GuidanceGroups.AddRange(ISOGuidanceGroup.ReadXML(ggpNodes));
            }

            return(field);
        }