/// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override IFeature DeepClone()
 {
     return(new WeatherForecastWarningArea
     {
         FeatureName = FeatureName == null
             ? new[] { new FeatureName() }
             : Array.ConvertAll(FeatureName, fn => fn.DeepClone() as IFeatureName),
         FeatureObjectIdentifier = FeatureObjectIdentifier == null
             ? new FeatureObjectIdentifier()
             : FeatureObjectIdentifier.DeepClone() as IFeatureObjectIdentifier,
         FixedDateRange = FixedDateRange == null
             ? new DateRange()
             : FixedDateRange.DeepClone() as IDateRange,
         Id = Id,
         PeriodicDateRange = PeriodicDateRange == null
             ? new DateRange[0]
             : Array.ConvertAll(PeriodicDateRange, p => p.DeepClone() as IDateRange),
         SourceIndication = SourceIndication == null
             ? new SourceIndication()
             : SourceIndication.DeepClone() as ISourceIndication,
         TextContent = TextContent == null
             ? new TextContent[0]
             : Array.ConvertAll(TextContent, t => t.DeepClone() as ITextContent),
         Geometry = Geometry,
         CategoryOfFrctAndWarningArea = CategoryOfFrctAndWarningArea,
         Nationality = Nationality,
         Status = Status,
         Links = Links == null
             ? new Link[0]
             : Array.ConvertAll(Links, l => l.DeepClone() as ILink)
     });
 }
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override IFeature DeepClone()
 {
     return(new QualityOfNonBathymetricData
     {
         CategoryOfTemporalVariation = CategoryOfTemporalVariation,
         DataAssessment = DataAssessment,
         SourceIndication = SourceIndication == null
             ? new SourceIndication()
             : SourceIndication.DeepClone() as ISourceIndication,
         FeatureObjectIdentifier = FeatureObjectIdentifier == null
             ? new FeatureObjectIdentifier()
             : FeatureObjectIdentifier.DeepClone() as IFeatureObjectIdentifier,
         HorizontalDistanceUncertainty = HorizontalDistanceUncertainty == null
             ? new string[0]
             : Array.ConvertAll(HorizontalDistanceUncertainty, hdu => hdu),
         HorizontalPositionalUncertainty = HorizontalPositionalUncertainty == null
             ? new HorizontalPositionalUncertainty()
             : HorizontalPositionalUncertainty.DeepClone() as IHorizontalPositionalUncertainty,
         DirectionUncertainty = DirectionUncertainty,
         SurveyDateRange = SurveyDateRange == null
             ? new SurveyDateRange()
             : SurveyDateRange.DeepClone() as ISurveyDateRange,
         Geometry = Geometry,
         Id = Id,
         Links = Links == null
             ? new Link[0]
             : Array.ConvertAll(Links, l => l.DeepClone() as ILink)
     });
 }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public override IFeature FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            if (node != null && node.HasChildNodes)
            {
                if (node.FirstChild.Attributes.Count > 0)
                {
                    Id = node.FirstChild.Attributes["gml:id"].InnerText;
                }

                var featureObjectIdentifierNode = node.FirstChild.SelectSingleNode("s100:featureObjectIdentifier", mgr);
                if (featureObjectIdentifierNode != null && featureObjectIdentifierNode.HasChildNodes)
                {
                    FeatureObjectIdentifier = new FeatureObjectIdentifier();
                    FeatureObjectIdentifier.FromXml(featureObjectIdentifierNode, mgr);
                }

                var foidNode = node.FirstChild.SelectSingleNode("s100:featureObjectIdentifier", mgr);
                if (foidNode != null && foidNode.HasChildNodes)
                {
                    FeatureObjectIdentifier = new FeatureObjectIdentifier();
                    FeatureObjectIdentifier.FromXml(foidNode, mgr);
                }

                var maximumDisplayScaleNode = node.FirstChild.SelectSingleNode("maximumDisplayScale", mgr);
                if (maximumDisplayScaleNode != null)
                {
                    MaximumDisplayScale = maximumDisplayScaleNode.InnerText;
                }

                var minimumDisplayScaleNode = node.FirstChild.SelectSingleNode("minimumDisplayScale", mgr);
                if (minimumDisplayScaleNode != null)
                {
                    MinimumDisplayScale = minimumDisplayScaleNode.InnerText;
                }

                var linkNodes = node.FirstChild.SelectNodes("*[boolean(@xlink:href)]", mgr);
                if (linkNodes != null && linkNodes.Count > 0)
                {
                    var links = new List <Link>();
                    foreach (XmlNode linkNode in linkNodes)
                    {
                        var newLink = new Link();
                        newLink.FromXml(linkNode, mgr);
                        links.Add(newLink);
                    }
                    Links = links.ToArray();
                }
            }

            return(this);
        }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override IFeature DeepClone()
 {
     return(new MilitaryPracticeArea
     {
         FeatureName = FeatureName == null
             ? new[] { new FeatureName() }
             : Array.ConvertAll(FeatureName, fn => fn.DeepClone() as IFeatureName),
         FeatureObjectIdentifier = FeatureObjectIdentifier == null
             ? new FeatureObjectIdentifier()
             : FeatureObjectIdentifier.DeepClone() as IFeatureObjectIdentifier,
         FixedDateRange = FixedDateRange == null
             ? new DateRange()
             : FixedDateRange.DeepClone() as IDateRange,
         Id = Id,
         PeriodicDateRange = PeriodicDateRange == null
             ? new DateRange[0]
             : Array.ConvertAll(PeriodicDateRange, p => p.DeepClone() as IDateRange),
         SourceIndication = SourceIndication == null
             ? new SourceIndication()
             : SourceIndication.DeepClone() as ISourceIndication,
         TextContent = TextContent == null
             ? new TextContent[0]
             : Array.ConvertAll(TextContent, t => t.DeepClone() as ITextContent),
         Geometry = Geometry,
         CategoryOfMilitaryPracticeArea = CategoryOfMilitaryPracticeArea == null
             ? new string[0]
             : Array.ConvertAll(CategoryOfMilitaryPracticeArea, s => s),
         Nationality = Nationality,
         Restriction = Restriction == null
             ? new string[0]
             : Array.ConvertAll(Restriction, s => s),
         Status = Status == null
             ? new string[0]
             : Array.ConvertAll(Status, s => s),
         Links = Links == null
             ? new Link[0]
             : Array.ConvertAll(Links, l => l.DeepClone() as ILink)
     });
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mgr"></param>
        /// <returns></returns>
        public override IFeature FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            if (node != null && node.HasChildNodes)
            {
                if (node.FirstChild.Attributes.Count > 0)
                {
                    Id = node.FirstChild.Attributes["gml:id"].InnerText;
                }
            }

            var featureObjectIdentifierNode = node.FirstChild.SelectSingleNode("s100:featureObjectIdentifier", mgr);

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

            var periodicDateRangeNodes = node.FirstChild.SelectNodes("periodicDateRange", mgr);

            if (periodicDateRangeNodes != null && periodicDateRangeNodes.Count > 0)
            {
                var dateRanges = new List <DateRange>();
                foreach (XmlNode periodicDateRangeNode in periodicDateRangeNodes)
                {
                    var newDateRange = new DateRange();
                    newDateRange.FromXml(periodicDateRangeNode, mgr);
                    dateRanges.Add(newDateRange);
                }
                PeriodicDateRange = dateRanges.ToArray();
            }

            var fixedDateRangeNode = node.FirstChild.SelectSingleNode("fixedDateRange", mgr);

            if (fixedDateRangeNode != null && fixedDateRangeNode.HasChildNodes)
            {
                FixedDateRange = new DateRange();
                FixedDateRange.FromXml(fixedDateRangeNode, mgr);
            }

            var featureNameNodes = node.FirstChild.SelectNodes("featureName", mgr);

            if (featureNameNodes != null && featureNameNodes.Count > 0)
            {
                var featureNames = new List <FeatureName>();
                foreach (XmlNode featureNameNode in featureNameNodes)
                {
                    var newFeatureName = new FeatureName();
                    newFeatureName.FromXml(featureNameNode, mgr);
                    featureNames.Add(newFeatureName);
                }
                FeatureName = featureNames.ToArray();
            }

            var sourceIndication = node.FirstChild.SelectSingleNode("sourceIndication", mgr);

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

            var textContentNodes = node.FirstChild.SelectNodes("textContent", mgr);

            if (textContentNodes != null && textContentNodes.Count > 0)
            {
                var textContents = new List <TextContent>();
                foreach (XmlNode textContentNode in textContentNodes)
                {
                    if (textContentNode != null && textContentNode.HasChildNodes)
                    {
                        var content = new TextContent();
                        content.FromXml(textContentNode, mgr);
                        textContents.Add(content);
                    }
                }
                TextContent = textContents.ToArray();
            }

            var categoryOfFrctAndWarningAreaNode = node.FirstChild.SelectSingleNode("categoryOfFrcstAndWarningArea", mgr);

            if (categoryOfFrctAndWarningAreaNode != null && categoryOfFrctAndWarningAreaNode.HasChildNodes)
            {
                CategoryOfFrctAndWarningArea = categoryOfFrctAndWarningAreaNode.FirstChild.InnerText;
            }

            var nationalityNode = node.FirstChild.SelectSingleNode("nationality", mgr);

            if (nationalityNode != null && nationalityNode.HasChildNodes)
            {
                Nationality = nationalityNode.FirstChild.InnerText;
            }

            var statusNode = node.FirstChild.SelectSingleNode("status", mgr);

            if (statusNode != null && statusNode.HasChildNodes)
            {
                Status = statusNode.FirstChild.InnerText;
            }

            var linkNodes = node.FirstChild.SelectNodes("*[boolean(@xlink:href)]", mgr);

            if (linkNodes != null && linkNodes.Count > 0)
            {
                var links = new List <Link>();
                foreach (XmlNode linkNode in linkNodes)
                {
                    var newLink = new Link();
                    newLink.FromXml(linkNode, mgr);
                    links.Add(newLink);
                }
                Links = links.ToArray();
            }

            return(this);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mgr"></param>
        /// <returns></returns>
        public override IFeature FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            if (node != null && node.HasChildNodes)
            {
                if (node.FirstChild.Attributes.Count > 0)
                {
                    Id = node.FirstChild.Attributes["gml:id"].InnerText;
                }

                var featureObjectIdentifierNode = node.FirstChild.SelectSingleNode("s100:featureObjectIdentifier", mgr);
                if (featureObjectIdentifierNode != null && featureObjectIdentifierNode.HasChildNodes)
                {
                    FeatureObjectIdentifier = new FeatureObjectIdentifier();
                    FeatureObjectIdentifier.FromXml(featureObjectIdentifierNode, mgr);
                }

                var categoryOfTemporalVariation = node.FirstChild.SelectSingleNode("categoryOfTemporalVariation", mgr);
                if (categoryOfTemporalVariation != null)
                {
                    CategoryOfTemporalVariation = categoryOfTemporalVariation.InnerText;
                }

                var dataAssessment = node.FirstChild.SelectSingleNode("dataAssessment", mgr);
                if (dataAssessment != null)
                {
                    DataAssessment = dataAssessment.InnerText;
                }

                var sourceIndicationNode = node.FirstChild.SelectSingleNode("sourceIndication", mgr);
                if (sourceIndicationNode != null && sourceIndicationNode.HasChildNodes)
                {
                    SourceIndication = new SourceIndication();
                    SourceIndication.FromXml(sourceIndicationNode, mgr);
                }

                var horizontalDistanceUncertaintyNodes = node.FirstChild.SelectNodes("horizontalDistanceUncertainty", mgr);
                if (horizontalDistanceUncertaintyNodes != null && horizontalDistanceUncertaintyNodes.Count > 0)
                {
                    var distanceUncertainties = new List <string>();
                    foreach (XmlNode horizontalDistanceUncertaintyNode in horizontalDistanceUncertaintyNodes)
                    {
                        if (horizontalDistanceUncertaintyNode != null && horizontalDistanceUncertaintyNode.HasChildNodes)
                        {
                            distanceUncertainties.Add(horizontalDistanceUncertaintyNode.FirstChild.InnerText);
                        }
                    }
                    HorizontalDistanceUncertainty = distanceUncertainties.ToArray();
                }

                var horizontalPositionalUncertaintyNode = node.FirstChild.SelectSingleNode("horizontalPositionalUncertainty", mgr);
                if (horizontalPositionalUncertaintyNode != null && horizontalPositionalUncertaintyNode.HasChildNodes)
                {
                    HorizontalPositionalUncertainty = new HorizontalPositionalUncertainty();
                    HorizontalPositionalUncertainty.FromXml(horizontalPositionalUncertaintyNode, mgr);
                }

                var directionUncertaintyNode = node.FirstChild.SelectSingleNode("directionUncertainty", mgr);
                if (directionUncertaintyNode != null && directionUncertaintyNode.HasChildNodes)
                {
                    DirectionUncertainty = directionUncertaintyNode.FirstChild.InnerText;
                }

                var surveyDateRangeNode = node.FirstChild.SelectSingleNode("surveyDateRange", mgr);
                if (surveyDateRangeNode != null && surveyDateRangeNode.HasChildNodes)
                {
                    SurveyDateRange = new SurveyDateRange();
                    SurveyDateRange.FromXml(surveyDateRangeNode, mgr);
                }

                var informationNode = node.FirstChild.SelectSingleNode("information", mgr);
                if (informationNode != null && informationNode.HasChildNodes)
                {
                    Information = new Information();
                    Information.FromXml(informationNode, mgr);
                }
            }

            var linkNodes = node.FirstChild.SelectNodes("*[boolean(@xlink:href)]", mgr);

            if (linkNodes != null && linkNodes.Count > 0)
            {
                var links = new List <Link>();
                foreach (XmlNode linkNode in linkNodes)
                {
                    var newLink = new Link();
                    newLink.FromXml(linkNode, mgr);
                    links.Add(newLink);
                }
                Links = links.ToArray();
            }

            return(this);
        }