Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mgr"></param>
        /// <returns></returns>
        public override IComplexType FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            var individualNameNode = node.SelectSingleNode("individualName");

            if (individualNameNode != null && individualNameNode.HasChildNodes)
            {
                IndividualName = individualNameNode.FirstChild.InnerText;
            }

            var organizationNameNode = node.SelectSingleNode("organizationName");

            if (organizationNameNode != null && organizationNameNode.HasChildNodes)
            {
                OrganizationName = organizationNameNode.FirstChild.InnerText;
            }

            var positionNameNode = node.SelectSingleNode("positionName");

            if (positionNameNode != null && positionNameNode.HasChildNodes)
            {
                PositionName = positionNameNode.FirstChild.InnerText;
            }

            var contactAddressNode = node.SelectSingleNode("contactAddress");

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

            var onlineResourceNode = node.SelectSingleNode("onlineResource");

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

            var telecommunicationsNode = node.SelectSingleNode("telecommunications");

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

            return(this);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mgr"></param>
        /// <returns></returns>
        public override IComplexType FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            var categoryOfTextNode = node.SelectSingleNode("categoryOfText", mgr);

            if (categoryOfTextNode != null && categoryOfTextNode.HasChildNodes)
            {
                CategoryOfText = categoryOfTextNode.FirstChild.InnerText;
            }

            var informationNodes = node.SelectNodes("information", mgr);

            if (informationNodes != null && informationNodes.Count > 0)
            {
                var informations = new List <Information>();
                foreach (XmlNode informationNode in informationNodes)
                {
                    if (informationNode != null && informationNode.HasChildNodes)
                    {
                        var newInformation = new Information();
                        newInformation.FromXml(informationNode, mgr);
                        informations.Add(newInformation);
                    }
                }
                Information = informations.ToArray();
            }

            var onlineResourceNode = node.SelectSingleNode("onlineResource");

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

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

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

            return(this);
        }