Esempio n. 1
0
        private object ToXmlProxy()
        {
            var proxy = new XsdNs.GetObservationResponseType();

            // Populating data from the base class
            PopulateExtensibleResponseToProxy(proxy);

            // These enable unique identifiers within the XML document
            var idPrefix  = "GetObsResp_i";
            var idCounter = 1;

            // Adding observations
            if (Observations.Count > 0)
            {
                proxy.observationData = new XsdNs.GetObservationResponseTypeObservationData[Observations.Count];

                for (int a = 0; a < Observations.Count; ++a)
                {
                    proxy.observationData[a] = new XsdNs.GetObservationResponseTypeObservationData();
                    var idPrefWithCounter = BuildIdPrefix(idPrefix, idCounter);
                    proxy.observationData[a].OM_Observation = Observations[a].ToXmlProxy(idPrefWithCounter);

                    ++idCounter;
                }
            }

            return(proxy);
        }
Esempio n. 2
0
 private void ReadFieldValueFromXmlDoc(XsdNs.GetObservationResponseType proxy)
 {
     // Reading observation data
     if (proxy.observationData != null)
     {
         foreach (var item in proxy.observationData)
         {
             var newObs = new Observation(item.OM_Observation);
             Observations.Add(newObs);
         }
     }
 }