protected override void OnInvoked()
        {
            switch (this.GetDownloadState())
            {
            case EDownloadTaskState.DLTaskPendingAttach:
            case EDownloadTaskState.DLTaskPending:
            case EDownloadTaskState.DLTaskDownloading:
            case EDownloadTaskState.DLTaskPaused:
                ZuneShell.DefaultInstance.Execute("Marketplace\\Downloads\\Home", null);
                break;

            case EDownloadTaskState.DLTaskComplete:
                PodcastLibraryPage.FindInCollection((int)this.m_episode.GetProperty("SeriesId"), (int)this.m_episode.GetProperty("LibraryId"));
                break;

            default:
                if (this.m_requireSignIn && !SignIn.Instance.SignedIn || this.m_explicit && ZuneApplication.Service.BlockExplicitContent())
                {
                    break;
                }
                DownloadEpisode(this.m_episode);
                this.Refresh();
                break;
            }
        }
Exemplo n.º 2
0
        public void FindInCollection()
        {
            Microsoft.Zune.Service.EContentType contentType = this.ContentType;
            if (contentType == Microsoft.Zune.Service.EContentType.PodcastEpisode)
            {
                PodcastLibraryPage.FindInCollection(-1, this.PodcastEpisodeId);
            }
            else if ((this.DownloadFlags & Microsoft.Zune.Service.EDownloadFlags.Channel) != Microsoft.Zune.Service.EDownloadFlags.None)
            {
                if (this.PlaylistId > 0)
                {
                    MusicLibraryPage.FindPlaylistInCollection(this.PlaylistId, this.CollectionId, true);
                }
                else
                {
                    ChannelLibraryPage.FindInCollection(this.SubscriptionMediaId, this.SubscriptionItemMediaId);
                }
            }
            else
            {
                if (this.CollectionId < 0)
                {
                    return;
                }
                switch (contentType)
                {
                case Microsoft.Zune.Service.EContentType.MusicTrack:
                    MusicLibraryPage.FindInCollection(-1, -1, this.CollectionId);
                    break;

                case Microsoft.Zune.Service.EContentType.Video:
                    VideoLibraryPage.FindInCollection(this.CollectionId);
                    break;

                case Microsoft.Zune.Service.EContentType.App:
                    ApplicationLibraryPage.FindInCollection(this.CollectionId);
                    break;
                }
            }
        }
        private void OnConfirm(object sender, EventArgs args)
        {
            SubscriptionManager instance = SubscriptionManager.Instance;
            int subscriptionMediaId      = -1;

            if (!instance.FindByUrl(this.m_feedUrl, EMediaTypes.eMediaTypePodcastSeries, out subscriptionMediaId, out bool _))
            {
                HRESULT hresult = instance.Subscribe(this.m_feedUrl, this.m_feedTitle, Guid.Empty, false, EMediaTypes.eMediaTypePodcastSeries, ESubscriptionSource.eSubscriptionSourceProtocolHandler, out subscriptionMediaId);
                if (hresult.IsSuccess)
                {
                    string endPointUri = Service.GetEndPointUri(EServiceEndpointId.SEID_RootCatalog);
                    if (!string.IsNullOrEmpty(endPointUri) && !string.IsNullOrEmpty(this.m_feedUrl) && this.m_feedUrl.Length < 1024)
                    {
                        WebRequestHelper.ConstructWebPostRequest(endPointUri + "/podcast", "URL=" + this.m_feedUrl, EPassportPolicyId.None, HttpRequestCachePolicy.Default, true, false).GetResponseAsync(new AsyncRequestComplete(this.OnRequestComplete), null);
                    }
                }
                else
                {
                    ErrorDialogInfo.Show(hresult.Int, Shell.LoadString(StringId.IDS_PODCAST_SUBSCRIPTION_ERROR));
                }
            }
            PodcastLibraryPage.FindInCollection(subscriptionMediaId);
        }