コード例 #1
0
        /// <summary>
        ///  Initializes the Address object
        /// </summary>
        /// <remarks>
        /// If a state is provided without a country, the country is assumed to the United States
        /// </remarks>
        /// <param name="ls">The Associated Location Street Object</param>
        /// <param name="city">The City</param>
        /// <param name="state">The State</param>
        /// <param name="country">(Optional) The Country.</param>
        /// <param name="postCode">(Optional) The Postal Code</param>
        /// <param name="buildingName">(Optional) The name of the building</param>
        /// <param name="countyCode">(Optional) The County Code</param>
        /// <param name="postExt">(Optional) The Postal Code Extension</param>
        private void Initialize(LocationStreet ls, string city, USStateCodeList?state, CountryCodeList?country = null, string postCode = null, string buildingName = null, int?countyCode = null, string postExt = null)
        {
            if (ls != null)
            {
                LocationStreet = ls;
            }
            if (!string.IsNullOrWhiteSpace(city))
            {
                LocationCityName = city;
            }
            if (state != null)
            {
                LocationState = (USStateCodeList)state;
            }
            if (country != null)
            {
                LocationCountry = (CountryCodeList)country;
            }
            if (!string.IsNullOrWhiteSpace(postCode))
            {
                LocationPostalCode = postCode;
            }
            if (!string.IsNullOrWhiteSpace(buildingName))
            {
                AddressBuildingName = buildingName;
            }
            if (countyCode != null)
            {
                LocationCountyCode = countyCode;
            }
            if (!string.IsNullOrWhiteSpace(postExt))
            {
                LocationPostalExtensionCode = postExt;
            }

            if (state != null && country == null)
            {
                LocationCountry = CountryCodeList.US;
            }
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the Address class
 /// </summary>
 /// <remarks>
 /// If a state is provided without a country, the country is assumed to the United States
 /// </remarks>
 /// <param name="ls">The Associated Location Street Object</param>
 /// <param name="city">(Optional) The city</param>
 /// <param name="state">(Optional) The State</param>
 /// <param name="country">(Optional) The country</param>
 /// <param name="postCode">(Optional) The Postal Code</param>
 /// <see cref="Initialize(LocationStreet, string, USStateCodeList?, CountryCodeList?, string, string, int?, string)"/>
 public Address(LocationStreet ls, string city = null, USStateCodeList?state = null, CountryCodeList?country = null, string postCode = null)
 {
     Initialize(ls, city, state, country, postCode);
 }
コード例 #3
0
 /// <summary>
 /// Sets the street for this address
 /// </summary>
 /// <param name="ls"></param>
 public void SetStreet(LocationStreet ls)
 {
     LocationStreet = ls;
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the AddressCrossStreet class
 /// </summary>
 public AddressCrossStreet()
 {
     LocationStreet = new LocationStreet();
 }