Exemplo n.º 1
0
        /// <summary>
        /// Returns a string to display to the user for suburb, country subdivision (state) and postcode of an
        /// address. Does not include the country.
        /// </summary>
        public string ToString(bool hasSubdivisionAccess, bool hasSubSubdivisionAccess)
        {
            if (UnstructuredLocation != null)
            {
                // If the "unstructured" location is set then it wasn't completely resolved.
                // Only return it though if suburb and subdivision access is provided.

                if (hasSubdivisionAccess && hasSubSubdivisionAccess)
                {
                    return(UnstructuredLocation);
                }

                // Check the subdivision access to determine whether to return just that.

                if (hasSubdivisionAccess)
                {
                    return(CountrySubdivision == null ? string.Empty : (CountrySubdivision.ShortName ?? string.Empty));
                }
                return(string.Empty);
            }

            return(NamedLocation == null ? string.Empty : LocationString.ToString(NamedLocation, CountrySubdivision, hasSubdivisionAccess, hasSubSubdivisionAccess));
        }
Exemplo n.º 2
0
 public string ToStringPostcodeFirst()
 {
     return(LocationString.ToString(this, false));
 }
Exemplo n.º 3
0
 public override string ToString()
 {
     return(LocationString.ToString(this));
 }