public PostalAddressFormat Format(PostalAddress postalAddress)
 {
     if (postalAddress == null)
         throw new ArgumentNullException("postalAddress", "postalAddress is null.");
     if (postalAddress.AddressType.ToLowerInvariant() != "bag")
     {
         throw new ArgumentOutOfRangeException("postalAddress", string.Format("Invalid AddressType. Expected 'bag' but was '{0}'", postalAddress.AddressType.ToLowerInvariant()));
     }
     PostalAddressFormat format = new PostalAddressFormat();
     format.AddressType = postalAddress.AddressType;
     format.AddressLine1 = GetAddressLine1(postalAddress);
     format.AddressLine2 = postalAddress.BoxBagLobbyName;
     format.AddressLine3 = string.Empty;
     format.Suburb = string.Empty;
     format.City = postalAddress.TownCityMailTown;
     format.PostCode = postalAddress.PostCode;
     format.AddressOneLine = string.Join(", ", new string[] { format.AddressLine1, format.Suburb, format.City, format.PostCode });
     return format;
 }
 public PostalAddressFormat Format(PostalAddress postalAddress)
 {
     if (postalAddress == null)
         throw new ArgumentNullException("postalAddress", "postalAddress is null.");
     if (postalAddress.AddressType.ToLowerInvariant() != "urban")
     {
         throw new ArgumentOutOfRangeException("postalAddress", string.Format("Invalid AddressType. Expected 'urban' but was '{0}'", postalAddress.AddressType.ToLowerInvariant()));
     }
     PostalAddressFormat format = new PostalAddressFormat();
     format.AddressType = postalAddress.AddressType;
     format.AddressLine1 = GetAddressLine1(postalAddress);
     format.AddressLine2 = GetAddressLine2(postalAddress);
     format.AddressLine3 = postalAddress.SuburbName != format.AddressLine2 ? postalAddress.SuburbName : string.Empty;
     format.Suburb = postalAddress.SuburbName;
     format.City = postalAddress.TownCityMailTown;
     format.PostCode = postalAddress.PostCode;
     format.AddressOneLine = string.Join(", ", string.Join("~", new string[] { format.AddressLine1, format.AddressLine2, format.AddressLine3, string.Format("{0} {1}", format.City, format.PostCode) }).Split("~".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToArray());
     return format;
 }