Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mgr"></param>
        /// <returns></returns>
        public override IComplexType FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            var categoryOfScheduleNode = node.SelectSingleNode("categoryOfSchedule", mgr);

            if (categoryOfScheduleNode != null && categoryOfScheduleNode.HasChildNodes)
            {
                CategoryOfSchedule = categoryOfScheduleNode.FirstChild.InnerText;
            }

            var tmIntervalsByDoWNodes = node.SelectNodes("tmIntervalsByDoW", mgr);

            if (tmIntervalsByDoWNodes != null && tmIntervalsByDoWNodes.Count > 0)
            {
                var intervals = new List <TmIntervalsByDoW>();
                foreach (XmlNode tmIntervalsByDoWNode in tmIntervalsByDoWNodes)
                {
                    if (tmIntervalsByDoWNode != null && tmIntervalsByDoWNode.HasChildNodes)
                    {
                        var newInterval = new TmIntervalsByDoW();
                        newInterval.FromXml(tmIntervalsByDoWNode, mgr);
                        intervals.Add(newInterval);
                    }
                }
                TmIntervalsByDoW = intervals.ToArray();
            }

            return(this);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mgr"></param>
        /// <returns></returns>
        public override IComplexType FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            var categoryOfCommPrefNode = node.SelectSingleNode("categoryOfCommPref", mgr);

            if (categoryOfCommPrefNode != null && categoryOfCommPrefNode.HasChildNodes)
            {
                CategoryOfCommPref = categoryOfCommPrefNode.FirstChild.InnerText;
            }

            var categoryOfMaritimeBroadcastNodes = node.SelectNodes("categoryOfMaritimeBroadcast", mgr);

            if (categoryOfMaritimeBroadcastNodes != null && categoryOfMaritimeBroadcastNodes.Count > 0)
            {
                var nodes = new List <string>();
                foreach (XmlNode categoryOfMaritimeBroadcastNode in categoryOfMaritimeBroadcastNodes)
                {
                    if (categoryOfMaritimeBroadcastNode != null && categoryOfMaritimeBroadcastNode.HasChildNodes)
                    {
                        nodes.Add(categoryOfMaritimeBroadcastNode.FirstChild.InnerText);
                    }
                }

                CategoryOfMaritimeBroadcast = nodes.ToArray();
            }

            var categoryOfRadioMethodsNodes = node.SelectNodes("categoryOfRadioMethods", mgr);

            if (categoryOfRadioMethodsNodes != null && categoryOfRadioMethodsNodes.Count > 0)
            {
                var nodes = new List <string>();
                foreach (XmlNode categoryOfRadioMethodsNode in categoryOfRadioMethodsNodes)
                {
                    if (categoryOfRadioMethodsNode != null && categoryOfRadioMethodsNode.HasChildNodes)
                    {
                        nodes.Add(categoryOfRadioMethodsNode.FirstChild.InnerText);
                    }
                }

                CategoryOfRadioMethods = nodes.ToArray();
            }

            var communicationChannelNodes = node.SelectNodes("communicationChannel", mgr);

            if (communicationChannelNodes != null && communicationChannelNodes.Count > 0)
            {
                var nodes = new List <string>();
                foreach (XmlNode communicationChannelNode in communicationChannelNodes)
                {
                    if (communicationChannelNode != null && communicationChannelNode.HasChildNodes)
                    {
                        nodes.Add(communicationChannelNode.FirstChild.InnerText);
                    }
                }

                CommunicationChannel = nodes.ToArray();
            }

            var contactInstructionsNode = node.SelectSingleNode("contactInstructions", mgr);

            if (contactInstructionsNode != null && contactInstructionsNode.HasChildNodes)
            {
                ContactInstructions = contactInstructionsNode.FirstChild.InnerText;
            }

            var facsimileDrumSpeedNode = node.SelectSingleNode("facsimileDrumSpeed", mgr);

            if (facsimileDrumSpeedNode != null && facsimileDrumSpeedNode.HasChildNodes)
            {
                FacsimileDrumSpeed = new FacsimileDrumSpeed();
                FacsimileDrumSpeed.FromXml(facsimileDrumSpeedNode, mgr);
            }

            var frequencyPairNodes = node.SelectNodes("frequencyPair", mgr);

            if (frequencyPairNodes != null && frequencyPairNodes.Count > 0)
            {
                var frequencyPairs = new List <FrequencyPair>();
                foreach (XmlNode frequencyPairNode in frequencyPairNodes)
                {
                    if (frequencyPairNode != null && frequencyPairNode.HasChildNodes)
                    {
                        var newFrequencyPair = new FrequencyPair();
                        newFrequencyPair.FromXml(frequencyPairNode, mgr);
                        frequencyPairs.Add(newFrequencyPair);
                    }
                }
                FrequencyPair = frequencyPairs.ToArray();
            }

            var tmIntervalsByDoWNodes = node.SelectNodes("tmIntervalsByDoW", mgr);

            if (tmIntervalsByDoWNodes != null && tmIntervalsByDoWNodes.Count > 0)
            {
                var tmIntervals = new List <TmIntervalsByDoW>();
                foreach (XmlNode tmIntervalsByDoWNode in tmIntervalsByDoWNodes)
                {
                    if (tmIntervalsByDoWNode != null && tmIntervalsByDoWNode.HasChildNodes)
                    {
                        var newTmInterval = new TmIntervalsByDoW();
                        newTmInterval.FromXml(tmIntervalsByDoWNode, mgr);
                        tmIntervals.Add(newTmInterval);
                    }
                }
                TmIntervalsByDoW = tmIntervals.ToArray();
            }

            var selectiveCallNumberNode = node.SelectSingleNode("selectiveCallNumber");

            if (selectiveCallNumberNode != null && selectiveCallNumberNode.HasChildNodes)
            {
                SelectiveCallNumber = selectiveCallNumberNode.FirstChild.InnerText;
            }

            var signalFrequencyNode = node.SelectSingleNode("signalFrequency");

            if (signalFrequencyNode != null && signalFrequencyNode.HasChildNodes)
            {
                SignalFrequency = signalFrequencyNode.FirstChild.InnerText;
            }

            var timeOfObservationNode = node.SelectSingleNode("timeOfObservation", mgr);

            if (timeOfObservationNode != null && timeOfObservationNode.HasChildNodes)
            {
                TimeOfObservation = new TimeOfObservation();
                TimeOfObservation.FromXml(timeOfObservationNode, mgr);
            }

            var timesOfTransmissionNode = node.SelectSingleNode("timesOfTransmission", mgr);

            if (timesOfTransmissionNode != null && timesOfTransmissionNode.HasChildNodes)
            {
                TimesOfTransmission = new TimesOfTransmission();
                TimesOfTransmission.FromXml(timesOfTransmissionNode, mgr);
            }

            var transmissionContentNode = node.SelectSingleNode("transmissionContent", mgr);

            if (transmissionContentNode != null && transmissionContentNode.HasChildNodes)
            {
                TransmissionContent = transmissionContentNode.FirstChild.InnerText;
            }

            var transmissionRegularityNodes = node.SelectNodes("transmissionRegularity", mgr);

            if (transmissionRegularityNodes != null && transmissionRegularityNodes.Count > 0)
            {
                var transmissions = new List <string>();
                foreach (XmlNode transmissionRegularityNode in transmissionRegularityNodes)
                {
                    transmissions.Add(transmissionRegularityNode.FirstChild.InnerText);
                }
                TransmissionRegularity = transmissions.ToArray();
            }

            return(this);
        }