private static GoogleCardMessage BuildGoogleCardFrom(Visit visit)
        {
            if (visit.MyProperty != null)
            {
                var mapImage = GoogleMapsHelper.GetStaticMapLinkFor(visit.MyProperty.MapAddress);
                var mapLink  = GoogleMapsHelper.GetGoogleMapsLinkFor(visit.MyProperty.MapAddress);

                if (string.IsNullOrEmpty(visit.Description))
                {
                    return(GoogleCardBuilder.Create()
                           .Title($"Visit {visit.Title}")
                           .Content("There is no description for this visit")
                           .Image(mapImage, "Map of visit location.")
                           .WithButton("Open Map", mapLink)
                           .Build());
                }
                return(GoogleCardBuilder.Create()
                       .Title($"Visit {visit.Title}")
                       .Content(visit.Description)
                       .Image(mapImage, "Map of visit location.")
                       .WithButton("Open Map", mapLink)
                       .Build());
            }
            return(GoogleCardBuilder.Create()
                   .Title($"Visit {visit.Title}")
                   .Content(visit.Description)
                   .Build());
        }
        private static GoogleCardMessage BuildGoogleCardFrom(CreateJobContext createJobContext, string description)
        {
            var mapImage = GoogleMapsHelper.GetStaticMapLinkFor(createJobContext.Property.MapAddress);
            var mapLink  = GoogleMapsHelper.GetGoogleMapsLinkFor(createJobContext.Property.MapAddress);

            return(GoogleCardBuilder.Create()
                   .Title($"New Job for {createJobContext.Client.Name}")
                   .Content(description)
                   .Image(mapImage, "Map of job location.")
                   .WithButton("Open Map", mapLink)
                   .Build());
        }
コード例 #3
0
 private static GoogleCardMessage BuildGoogleCardFrom(Visit visit)
 {
     if (visit.MyProperty != null)
     {
         var mapImage = GoogleMapsHelper.GetStaticMapLinkFor(visit.MyProperty.MapAddress);
         var mapLink  = GoogleMapsHelper.GetGoogleMapsLinkFor(visit.MyProperty.MapAddress);
         return(GoogleCardBuilder.Create()
                .Title($"Visit {visit.Title}")
                .Content($"At {visit.MyProperty.MapAddress}.")
                .Image(mapImage, "Map of visit location.")
                .WithButton("Open Map", mapLink)
                .Build());
     }
     return(GoogleCardBuilder.Create()
            .Title($"Visit {visit.Title}")
            .Build());
 }