Esempio n. 1
0
        void playFac_GetPlayInfoSucceed(object sender, HttpFactoryArgs <PlayInfo> args)
        {
            ProgramInfo curProgramInfo = _downProgramInfo[sender as PlayInfoFactory];

            PlayInfo.Item item = args.Result.GetItemByFileType(5);
            if (item == null)
            {
                // _downSign.Visibility = Visibility.Collapsed;
                _downSign.Foreground = new SolidColorBrush(Colors.White);
                if (_piForDownload != null)
                {
                    _piForDownload.IsDown = Visibility.Collapsed;
                }
                string id = string.Empty;

                if (curProgramInfo == null)
                {
                    id = DetailPageHelp.ChannelDetailInfoForPrograms.VID.ToString() + "||";
                }
                else
                {
                    id = DetailPageHelp.ChannelDetailInfoForPrograms.VID + "|" + curProgramInfo.Index + "|" + curProgramInfo.ChannelVID;
                }

                foreach (DownPage.DownInfo info in DownPage.MyDownloading)
                {
                    if (info.VID == id)
                    {
                        DownPage.MyDownloading.Remove(info);
                        break;
                    }
                }
                DownPage.DownFactory.DeleteRecord(id);
                MessageBox.Show("无法下载该文件", "提示", MessageBoxButton.OK);
                return;
            }
            _rid = item.Rid;

            if (item.DtInfo != null)
            {
                _downUrl = item.url;
                if (curProgramInfo == null)
                {
                    DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID.ToString() + "||", _downUrl);
                }
                else
                {
                    DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID + "|" + curProgramInfo.Index + "|" + curProgramInfo.ChannelVID, _downUrl);
                }
            }
            else
            {
                string jump_url = "http://wp7.jump.synacast.com/" + item.Rid + "dt?type=mwp7";
                PPTVData.HttpWebClient jumpWebClient = new PPTVData.HttpWebClient();
                jumpWebClient.DownloadStringCompleted += new PPTVData.DownloadStringCompletedEventHandler(JumpWebClientDownloadStringCompleted);
                jumpWebClient.DownloadStringAsync(jump_url);
            }
        }
Esempio n. 2
0
 private void BeginSetChannelToVideoHub(ChannelDetailInfo channelDetailInfo)
 {
     if (channelDetailInfo != null)
     {
         if (!string.IsNullOrEmpty(channelDetailInfo.ImgUrl))
         {
             //WebClient clientByImage = new WebClient();
             //clientByImage.OpenReadCompleted += new OpenReadCompletedEventHandler(clientByImage_OpenReadCompleted);
             //clientByImage.OpenReadAsync(new Uri(channelDetailInfo.ImgUrl, UriKind.RelativeOrAbsolute));
             PPTVData.HttpWebClient webClient = new PPTVData.HttpWebClient();
             webClient.OpenReadCompleted += new PPTVData.OpenReadCompletedEventHandler(webClient_OpenReadCompleted);
             webClient.OpenReadAsync(channelDetailInfo.ImgUrl);
         }
     }
 }
Esempio n. 3
0
 void playFac_GetPlayInfoSucceed(object sender, HttpFactoryArgs <PPTVData.Entity.PlayInfo> args)
 {
     PPTVData.Entity.PlayInfo.Item item = args.Result.GetItemByFileType(5);
     if (item == null)
     {
         return;
     }
     _rid = item.Rid;
     if (item.DtInfo != null)
     {
         DownPage.UpdateTask(_vid, item.url);
     }
     else
     {
         string jump_url = "http://wp7.jump.synacast.com/" + item.Rid + "dt?type=mwp7";
         PPTVData.HttpWebClient jumpWebClient = new PPTVData.HttpWebClient();
         jumpWebClient.DownloadStringCompleted += new PPTVData.DownloadStringCompletedEventHandler(JumpWebClientDownloadStringCompleted);
         jumpWebClient.DownloadStringAsync(jump_url);
     }
 }
Esempio n. 4
0
        void playFac_GetPlayInfoSucceed(object sender, HttpFactoryArgs<PPTVData.Entity.PlayInfo> args)
        {
            PPTVData.Entity.PlayInfo.Item item = args.Result.GetItemByFileType(5);
            if (item == null)
                return;
            _rid = item.Rid;
            if (item.DtInfo != null)
            {

                DownPage.UpdateTask(_vid, item.url);

            }
            else
            {
                string jump_url = "http://wp7.jump.synacast.com/" + item.Rid + "dt?type=mwp7";
                PPTVData.HttpWebClient jumpWebClient = new PPTVData.HttpWebClient();
                jumpWebClient.DownloadStringCompleted += new PPTVData.DownloadStringCompletedEventHandler(JumpWebClientDownloadStringCompleted);
                jumpWebClient.DownloadStringAsync(jump_url);
            }
        }
Esempio n. 5
0
        void playFac_GetPlayInfoSucceed(object sender, HttpFactoryArgs<PlayInfo> args)
        {
            ProgramInfo curProgramInfo = _downProgramInfo[sender as PlayInfoFactory];
            PlayInfo.Item item = args.Result.GetItemByFileType(5);
            if (item == null)
            {

                // _downSign.Visibility = Visibility.Collapsed;
                _downSign.Foreground = new SolidColorBrush(Colors.White);
                if (_piForDownload != null)
                    _piForDownload.IsDown = Visibility.Collapsed;
                string id = string.Empty;

                if (curProgramInfo == null)
                    id = DetailPageHelp.ChannelDetailInfoForPrograms.VID.ToString() + "||";
                else
                {
                    id = DetailPageHelp.ChannelDetailInfoForPrograms.VID + "|" + curProgramInfo.Index + "|" + curProgramInfo.ChannelVID;
                }

                foreach (DownPage.DownInfo info in DownPage.MyDownloading)
                {
                    if (info.VID == id)
                    {
                        DownPage.MyDownloading.Remove(info);
                        break;
                    }
                }
                DownPage.DownFactory.DeleteRecord(id);
                MessageBox.Show("无法下载该文件", "提示", MessageBoxButton.OK);
                return;
            }
            _rid = item.Rid;

            if (item.DtInfo != null)
            {
                _downUrl = item.url;
                if (curProgramInfo == null)
                    DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID.ToString() + "||", _downUrl);
                else
                {
                    DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID + "|" + curProgramInfo.Index + "|" + curProgramInfo.ChannelVID, _downUrl);
                }
            }
            else
            {
                string jump_url = "http://wp7.jump.synacast.com/" + item.Rid + "dt?type=mwp7";
                PPTVData.HttpWebClient jumpWebClient = new PPTVData.HttpWebClient();
                jumpWebClient.DownloadStringCompleted += new PPTVData.DownloadStringCompletedEventHandler(JumpWebClientDownloadStringCompleted);
                jumpWebClient.DownloadStringAsync(jump_url);
            }
        }
Esempio n. 6
0
 private void BeginSetChannelToVideoHub(ChannelDetailInfo channelDetailInfo)
 {
     if (channelDetailInfo != null)
     {
         if (!string.IsNullOrEmpty(channelDetailInfo.ImgUrl))
         {
             //WebClient clientByImage = new WebClient();
             //clientByImage.OpenReadCompleted += new OpenReadCompletedEventHandler(clientByImage_OpenReadCompleted);
             //clientByImage.OpenReadAsync(new Uri(channelDetailInfo.ImgUrl, UriKind.RelativeOrAbsolute));
             PPTVData.HttpWebClient webClient = new PPTVData.HttpWebClient();
             webClient.OpenReadCompleted += new PPTVData.OpenReadCompletedEventHandler(webClient_OpenReadCompleted);
             webClient.OpenReadAsync(channelDetailInfo.ImgUrl);
         }
     }
 }