Exemplo n.º 1
0
        private Item GetTimeItemFromProxy(XsdNs.GetObservationTypeTemporalFilter proxy)
        {
            switch (proxy.TemporalOpsTypeInfo)
            {
            case XsdNs.TemporalObsTypeType.After:
            case XsdNs.TemporalObsTypeType.Before:

                // It is necessary to build a PropertyType object
                var timeInstantObj  = ((XsdNs.BinaryTemporalOpType_TimeInstant)proxy.TemporalOps).TimeInstant;
                var timeInstantProp = new XsdNs.TimeInstantPropertyType
                {
                    TimeInstant = timeInstantObj
                };

                return(new Item_TimeInstant(timeInstantProp));

            case XsdNs.TemporalObsTypeType.During:

                // It is necessary to build a PropertyType object
                var timePeriodObj  = ((XsdNs.BinaryTemporalOpType_TimePeriod)proxy.TemporalOps).TimePeriod;
                var timePeriodProp = new XsdNs.TimePeriodPropertyType
                {
                    TimePeriod = timePeriodObj
                };

                return(new Item_TimeRange(timePeriodProp));

            default:
                throw new XNeut.InvalidMessageException("Unsupported temporal operator in message: " + proxy.TemporalOpsTypeInfo.ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor. Use this to instantiate an item from XML (observation result).
        /// </summary>
        /// <param name="el">XML contents.</param>
        internal Item_TimeInstant(XsdNs.TimeInstantPropertyType el) : this(el.TimeInstant)
        {
            // The funny time-related metadata structures of O&M make this almost
            // redundant constructor about necessary.

            // ResultTime field uses this ctor, as well as Results of type TimeInstant.
        }