예제 #1
0
        /// <summary>
        /// Create an address based on the model property values.
        /// </summary>
        /// <param name="properties"></param>
        /// <returns></returns>
        private string GetAddress1(GModel.PropertyModel properties)
        {
            var address = new StringBuilder();

            if (!String.IsNullOrWhiteSpace($"{ properties.CivicNumber}"))
            {
                address.Append($"{properties.CivicNumber} ");
            }

            if (properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType))
            {
                address.Append($"{properties.StreetType} ");
            }

            if (properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection))
            {
                address.Append($"{properties.StreetDirection} ");
            }

            if (!String.IsNullOrWhiteSpace(properties.StreetName))
            {
                address.Append(properties.StreetName);
            }

            if (!String.IsNullOrWhiteSpace(properties.StreetQualifier))
            {
                address.Append($" {properties.StreetQualifier}");
            }

            if (!properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection))
            {
                address.Append($" {properties.StreetDirection}");
            }

            if (!properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType))
            {
                address.Append($" {properties.StreetType}");
            }
            return(address.ToString());
        }
예제 #2
0
 /// <summary>
 /// Get the administrative area name (city, municipality, district, etc.) based on the model property values.
 /// </summary>
 /// <param name="properties"></param>
 /// <returns></returns>
 private string GetAdministrativeArea(GModel.PropertyModel properties)
 {
     return(properties.LocalityName);
 }
예제 #3
0
 /// <summary>
 /// Get the city name based on the model property values.
 /// </summary>
 /// <param name="properties"></param>
 /// <returns></returns>
 private string GetCity(GModel.PropertyModel properties)
 {
     return(properties.LocalityType == "City" ? properties.LocalityName : null);
 }