コード例 #1
0
        /// <summary>
        /// Reads an XML Position From An Existing DOM
        /// </summary>
        /// <param name="rootnode">Node Containing the GML Position</param>
        public void ReadXML(XmlNode rootnode)
        {
            PersonNameType   persontemp;
            OrganizationName orgtemp;

            foreach (XmlNode childNode in rootnode.ChildNodes)
            {
                if (string.IsNullOrEmpty(childNode.InnerText))
                {
                    continue;
                }

                switch (childNode.LocalName)
                {
                case "PersonName":
                    persontemp = new PersonNameType();
                    persontemp.ReadXML(childNode);
                    this.personName.Add(persontemp);
                    break;

                case "OrganisationName":
                    orgtemp = new OrganizationName();
                    orgtemp.ReadXML(childNode);
                    this.orgName.Add(orgtemp);
                    break;

                default:
                    throw new ArgumentException("Unexpected Node Name: " + childNode.Name + " in PartyNameType");
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Reads an XML Position From An Existing DOM
        /// </summary>
        /// <param name="rootnode">Node Containing the GML Position</param>
        public void ReadXML(XmlNode rootnode)
        {
            AddressType   addrtemp;
            ContactNumber contacttemp;
            ElectronicAddressIdentifier eletemp;

            if (rootnode.LocalName == "OrganizationInformation")
            {
                foreach (XmlNode childnode in rootnode.ChildNodes)
                {
                    if (string.IsNullOrEmpty(childnode.InnerText))
                    {
                        continue;
                    }

                    switch (childnode.LocalName)
                    {
                    case "OrganisationName":
                        this.orgName = new OrganizationName();
                        this.orgName.ReadXML(childnode);
                        break;

                    case "Addresses":
                        foreach (XmlNode addressnode in childnode.ChildNodes)
                        {
                            addrtemp = new AddressType();
                            addrtemp.ReadXML(addressnode);
                            this.addresses.Add(addrtemp);
                        }

                        break;

                    case "ContactNumbers":
                        foreach (XmlNode contactnode in childnode.ChildNodes)
                        {
                            contacttemp = new ContactNumber();
                            contacttemp.ReadXML(contactnode);
                            this.contactNumbers.Add(contacttemp);
                        }

                        break;

                    case "ElectronicAddressIdentifiers":
                        foreach (XmlNode subnode in childnode.ChildNodes)
                        {
                            eletemp = new ElectronicAddressIdentifier();
                            eletemp.ReadXML(subnode);
                            this.electronicAddressIdentifiers.Add(eletemp);
                        }

                        break;

                    case "OrganisationInformation":
                        this.orgInfo = new OrganizationInfo();
                        this.orgInfo.ReadXML(childnode);
                        break;

                    case "#comment":
                        break;

                    default:
                        throw new ArgumentException("Invalid Child Node Name: " + childnode.Name + " in OrganizationInformation");
                    }
                }
            }
            else
            {
                throw new ArgumentException("Unexpected Node Name: " + rootnode.Name + " in OrganizationInformation");
            }
        }