/// <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); }
/// <summary> /// /// </summary> /// <returns></returns> public override IComplexType DeepClone() { return(new TextContent { CategoryOfText = CategoryOfText, Information = Information == null ? new Information[0] : Array.ConvertAll(Information, i => i.DeepClone() as IInformation), OnlineResource = OnlineResource == null ? new OnlineResource() : OnlineResource.DeepClone() as IOnlineResource, SourceIndication = SourceIndication == null ? new SourceIndication() : SourceIndication.DeepClone() as ISourceIndication }); }
/// <summary> /// /// </summary> /// <returns></returns> public override IComplexType DeepClone() { return(new ProducingAgency { IndividualName = IndividualName, OrganizationName = OrganizationName, PositionName = PositionName, ContactAddress = ContactAddress == null ? new ContactAddress() : ContactAddress.DeepClone() as IContactAddress, OnlineResource = OnlineResource == null ? new OnlineResource() : OnlineResource.DeepClone() as IOnlineResource, Telecommunications = Telecommunications == null ? new Telecommunications() : Telecommunications.DeepClone() as ITelecommunications }); }
/// <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); }