Exemplo n.º 1
0
 private void loadLatestPivotItem()
 {
     // Get latest
     UpcomingProgressBar.IsIndeterminate = true;
     UpcomingProgressBar.Visibility      = System.Windows.Visibility.Visible;
     LatestHtmlParser.selector           = latestListSelector;
     LatestHtmlParser.progressbar        = UpcomingProgressBar;
     LatestHtmlParser.loaded             = latestLoaded;
     LatestHtmlParser.parseLatestMovie();
 }
Exemplo n.º 2
0
        private async Task loadLatestPivotItem()
        {
            // Get latest
            bool fromDormant = false;

            UpcomingProgressBar.IsIndeterminate = true;
            UpcomingProgressBar.Visibility      = System.Windows.Visibility.Visible;
            try
            {
                latestListSelector.ItemsSource = await LatestHtmlParser.getLatestMovie();

                UpcomingProgressBar.Visibility = System.Windows.Visibility.Collapsed;
            }
            catch (TaskCanceledException)
            {
                if (App.isFromDormant)
                {
                    fromDormant = true;
                }
                else
                {
                    UpcomingProgressBar.Visibility = System.Windows.Visibility.Collapsed;
                    latestLoaded = false;
                    MessageBoxResult result = MessageBox.Show(AppResources.ConnectionError, "", MessageBoxButton.OK);
                }
            }
            catch (Exception)
            {
                if (App.isFromDormant)
                {
                    fromDormant = true;
                }
                else
                {
                    UpcomingProgressBar.Visibility = System.Windows.Visibility.Collapsed;
                    latestLoaded = false;
                    MessageBoxResult result = MessageBox.Show(AppResources.ConnectionError, "", MessageBoxButton.OK);
                }
            }
            if (fromDormant)
            {
                App.isFromDormant = false;
                await loadLatestPivotItem();
            }
        }