Exemplo n.º 1
0
        /// <summary>
        /// Get the next page of events for the current search and appends it to EventsList
        /// </summary>
        /// <returns> Task which is getting the events page asynchronously </returns>
        public async Task GetNextEventsPage()
        {
            List <Event> nextEventsPage;

            try
            {
                nextEventsPage = await Eventbrite.GetNextEventsPage();
            }
            catch (Eventbrite.NoMoreEventsPagesException)
            {
                return;
            }

            EventsList.AddRange(nextEventsPage);
            NotifyOfPropertyChange(() => EventsList);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Clears EventsList and populates it with a new page of events for the given location / proximity
        /// </summary>
        /// <param name="location"> Location to search </param>
        /// <param name="proximity"> Proximity in miles to the given location to search </param>
        /// <returns> Task which is getting the events page asynchronously </returns>
        public async Task GetNewEventsPage(string location, int proximity = 25)
        {
            List <Event> eventsPage;

            try
            {
                eventsPage = await Eventbrite.GetNewEventsPage(location, proximity);
            }
            catch (System.Net.WebException)
            {
                MessageBox.Show("No results found for your search. Check your internet location and city name / zip code");
                return;
            }
            EventsList.Clear();
            EventsList.AddRange(eventsPage);
            NotifyOfPropertyChange(() => EventsList);
        }