public async Task <IList <Venue> > GetVenuesAsync(double latitude, double longitude) { var url = VenueBase.GenerateURL(latitude, longitude); using (var client = new HttpClient()) { var response = await client.GetAsync(url); var json = await response.Content.ReadAsStringAsync(); var result = JsonConvert.DeserializeObject <VenueBase>(json); return(result.Response.Venues); } }
private static VenueBaseDto CreateHereVenue(VenueBase venue) { var hereVenue = venue as HereVenue; if (hereVenue == null || hereVenue.IsUseless()) { return(null); } return(new HereVenueDto { SourceType = venue.SourceType.ToString(), Category = venue.Category, Title = venue.Title, Address = venue.Address, ContactPhone = venue.ContactPhone, Website = venue.Websites == null ? null : string.Join(", ", venue.Websites), OpeningHours = venue.OpeningHours, WikipediaContent = hereVenue.WikipediaContent }); }
private static VenueBaseDto CreateFoursquareVenue(VenueBase venue) { var foursquareVenue = venue as FoursquareVenue; if (foursquareVenue == null || foursquareVenue.IsUseless()) { return(null); } return(new FoursquareVenueDto { SourceType = venue.SourceType.ToString(), Category = venue.Category, Title = venue.Title, Address = venue.Address, ContactPhone = venue.ContactPhone, Website = venue.Websites == null ? null : string.Join(", ", venue.Websites), OpeningHours = venue.OpeningHours, Rating = foursquareVenue.Rating, MaxRating = foursquareVenue.MaxRating, RatingColor = foursquareVenue.RatingColor, LikesCount = foursquareVenue.LikesCount, PriceLevel = foursquareVenue.PriceLevel.HasValue ? string.Join(string.Empty, Enumerable.Range(1, foursquareVenue.PriceLevel.Value).Select(x => foursquareVenue.PriceCurrency)) : null, RemainingPriceLevel = foursquareVenue.PriceLevel.HasValue ? string.Join(string.Empty, Enumerable.Range(1, foursquareVenue.PriceMaxLevel - foursquareVenue.PriceLevel.Value).Select(x => foursquareVenue.PriceCurrency)) : null, PhotoUrls = foursquareVenue.PhotoUrls, Tags = foursquareVenue.Tags, Tips = foursquareVenue.Tips?.Select(x => new FoursquareVenueTipDto { Message = x.Message, Likes = x.Likes, AgreeCount = x.AgreeCount, DisagreeCount = x.DisagreeCount }).ToArray() }); }
public static void SetVenue(FrameworkElement dp, VenueBase value) { dp.SetValue(VenueProperty, value); }
public DiscoveredVenueViewModel(VenueBase venue) { this.Venue = venue; }