Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the Party class
 /// Default Constructor - Initializes Lists
 /// </summary>
 public Party()
 {
     ////freeTextLines = new List<string>();
     this.partyName      = new PartyNameType();
     this.addresses      = new List <AddressType>();
     this.contactNumbers = new List <ContactNumber>();
     this.electronicAddressIdentifiers = new List <ElectronicAddressIdentifier>();
     this.identifiers = new List <Identifier>();
 }
Esempio n. 2
0
        /*
         * /// <summary>
         * /// Free text description of the party as line 1, line 2, line n.
         * /// </summary>
         * public List<string> FreeTextLines
         * {
         * get { return freeTextLines; }
         * set { freeTextLines = value; }
         * }*/

        #endregion

        #region Public Member Functions

        /// <summary>
        /// Reads an XML Position From An Existing DOM
        /// </summary>
        /// <param name="rootnode">Node Containing the GML Position</param>
        public void ReadXML(XmlNode rootnode)
        {
            PartyNameType partytemp;
            AddressType   addresstemp;
            ContactNumber contacttemp;
            ElectronicAddressIdentifier eletemp;
            Identifier idtemp;

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

                switch (childNode.LocalName)
                {
                case "PartyName":
                    partytemp = new PartyNameType();
                    partytemp.ReadXML(childNode);
                    break;

                case "Addresses":
                    foreach (XmlNode addressNode in childNode.ChildNodes)
                    {
                        if (addressNode.LocalName == "Address")
                        {
                            addresstemp = new AddressType();
                            addresstemp.ReadXML(addressNode);
                            this.addresses.Add(addresstemp);
                        }
                        else
                        {
                            throw new ArgumentException("Unexpected Node Name: " + addressNode.Name + " in PersonDetails");
                        }
                    }

                    break;

                case "ContactNumbers":
                    foreach (XmlNode contactNode in childNode.ChildNodes)
                    {
                        if (contactNode.LocalName == "ContactNumber")
                        {
                            contacttemp = new ContactNumber();
                            contacttemp.ReadXML(contactNode);
                            this.contactNumbers.Add(contacttemp);
                        }
                        else
                        {
                            throw new ArgumentException("Unexpected Node Name: " + contactNode.Name + " in PersonDetails");
                        }
                    }

                    break;

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

                    break;

                case "Identifiers":
                    foreach (XmlNode subnode in childNode.ChildNodes)
                    {
                        idtemp = new Identifier();
                        idtemp.ReadXML(subnode);
                        this.identifiers.Add(idtemp);
                    }

                    break;

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

                case "#comment":
                    break;

                default:
                    throw new ArgumentException("Unexpected Node Name: " + childNode.Name + " in PersonDetails");
                }
            }
        }