getInstance() public static method

public static getInstance ( ) : PodcastEpisodesDownloadManager
return PodcastEpisodesDownloadManager
        private void DownloadButton_Click(object sender, RoutedEventArgs e)
        {
            m_episodeModel = this.DataContext as PodcastEpisodeModel;
            PodcastEpisodesDownloadManager downloadManager = PodcastEpisodesDownloadManager.getInstance();

            PodcastEpisodesDownloadManager.notifyUserOfDownloadRestrictions(m_episodeModel);
            downloadManager.addEpisodeToDownloadQueue(m_episodeModel);
        }
Example #2
0
        public MainView()
        {
            InitializeComponent();

            this.DataContext = App.mainViewModels;

            // Hook to the event when the download list changes, so we can update the pivot header text for the
            // download page.
            ((INotifyCollectionChanged)EpisodeDownloadList.Items).CollectionChanged += downloadListChanged;

            // Upon startup, refresh all subscriptions so we get the latest episodes for each.
            m_subscriptionsManager = PodcastSubscriptionsManager.getInstance();
            m_subscriptionsManager.OnPodcastSubscriptionsChanged += new SubscriptionManagerHandler(m_subscriptionsManager_OnPodcastSubscriptionsChanged);
            m_subscriptionsManager.refreshSubscriptions();

            // Hook to SkyDrive export events
            m_subscriptionsManager.OnOPMLExportToSkydriveChanged += new SubscriptionManagerHandler(m_subscriptionsManager_OnOPMLExportToSkydriveChanged);

            m_applicationSettings = IsolatedStorageSettings.ApplicationSettings;

            // Hook to the event when the podcast player starts playing.
            m_playbackManager = PodcastPlaybackManager.getInstance();
            m_playbackManager.OnOpenPodcastPlayer += new EventHandler(PodcastPlayer_PodcastPlayerStarted);

            PodcastSubscriptionsManager.getInstance().OnPodcastChannelDeleteStarted
                += new SubscriptionManagerHandler(subscriptionManager_OnPodcastChannelDeleteStarted);
            PodcastSubscriptionsManager.getInstance().OnPodcastChannelDeleteFinished
                += new SubscriptionManagerHandler(subscriptionManager_OnPodcastChannelDeleteFinished);

            PodcastSubscriptionsManager.getInstance().OnPodcastChannelPlayedCountChanged
                += new SubscriptionChangedHandler(subscriptionManager_OnPodcastChannelPlayedCountChanged);
            PodcastSubscriptionsManager.getInstance().OnPodcastChannelAdded
                += new SubscriptionChangedHandler(subscriptionManager_OnPodcastChannelAdded);
            PodcastSubscriptionsManager.getInstance().OnPodcastChannelRemoved
                += new SubscriptionChangedHandler(subscriptionManager_OnPodcastChannelRemoved);

            SubscriptionsList.ItemsSource = m_subscriptions;

            if (m_subscriptions.Count > 0)
            {
                NoSubscriptionsLabel.Visibility = Visibility.Collapsed;
            }
            else
            {
                NoSubscriptionsLabel.Visibility = Visibility.Visible;
            }

            handleShowReviewPopup();

            // This is the earliest place that we can initialize the download manager so it can show the error toast
            // which is defined in App.
            App.episodeDownloadManager = PodcastEpisodesDownloadManager.getInstance();
        }
 private void StopDownloadImage_Tap(object sender, GestureEventArgs e)
 {
     PodcastEpisodesDownloadManager.getInstance().cancelEpisodeDownload(m_episodeModel);
 }