Exemple #1
0
        public AcContent GetBannerData()
        {
            AcContent ac = new AcContent();

            if (Str != null && Str != string.Empty)
            {
                var index    = Str.IndexOf("header-banner");
                var aindex   = Str.IndexOf("<a", index);
                var aend     = Str.IndexOf("</a>", index);
                var spanhead = Str.IndexOf("<span", index);
                var spanEnd  = Str.IndexOf("</span>", index);

                if (aindex != -1 || aend != -1 || spanhead != -1 || spanEnd != -1)
                {
                    var astr = Str.Substring(aindex, aend - aindex);
                    var span = Str.Substring(spanhead, spanEnd - spanhead);

                    if (astr == string.Empty || span == string.Empty)
                    {
                        return(ac);
                    }
                    var href    = astr.IndexOf("href=");
                    var hrefEnd = astr.IndexOf("\"", href + 10);
                    var url     = astr.Substring(href + 6, hrefEnd - href - 6);
                    ac.ACURL = url;

                    var spanstr = HtmlUtilities.ConvertToText(span);
                    ac.Title = spanstr;
                    return(ac);
                }
            }
            return(ac);
        }
 public void AddData(AcContent content)
 {
     ResizeView();
     if (content.Visit == null)
     {
         this.viewsBox.Visibility = this.viewIcon.Visibility = Visibility.Collapsed;
     }
     else
     {
         if (content.Visit.Views != null)
         {
             this.viewsBox.Text = content.Visit.Views;
         }
     }
     if (content.User != null)
     {
         UPNameBox.Text = content.User.Username;
     }
     else
     {
         UPNameBox.Text = "UP:你猜是谁";
     }
     coverBox.Source = new BitmapImage(new Uri(content.Cover));
     titleBox.Text   = content.Title;
 }
        private void RecommendListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            AcContent ac = e.ClickedItem as AcContent;

            if (ac != null)
            {
                this.Frame.Navigate(typeof(DetailsPage), ac);
            }
        }
Exemple #4
0
        private void MainGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            AcContent ac = e.ClickedItem as AcContent;

            if (ac != null)
            {
                NavigationToDetailsPage(ac);
            }
        }
Exemple #5
0
        private async Task <bool> InitFunc()
        {
            _detailData = new DetailData();
            var url = AcFunAPI.GetContentUrl(_SeleCContent.ContentId);
            await _detailData.GetData(url);

            _SeleCContent    = _detailData.ListOfACContent[0];
            _videoSourceData = new VideoSourceData();
            //url=AcFunAPI.GetVideoSrcUrl(_SeleCContent.DetailVideos[0].)
            //url=AcFunAPI.GetVideoSrcUrl(_SeleCContent.DetailVideos[0].)
            //await _videoSourceData.GetData()
            return(true);
        }
Exemple #6
0
        private async void GetDetailData()
        {
            DetailData dd  = new DetailData();
            var        url = AcFunAPI.GetContentUrl(_SeleCContent.ContentId);
            await dd.GetData(url);

            if (dd.ListOfACContent == null || dd.ListOfACContent.Count == 0)
            {
                //todo
                MSGSHOW("获取资源失败!");
                return;
            }
            _SeleCContent = dd.ListOfACContent[0];
            _selecVideo   = _SeleCContent.DetailVideos[0];
            GetVideoSourceData();
            AddVideoInfoDetail();
        }
Exemple #7
0
        public void AddAllData(AcContent data)
        {
            img.Width   = this.Width;
            img.Height  = this.Height - 60;
            title.Width = img.Width;
            //var temp = new BitmapImage();
            img.UriSource = new Uri(data.Cover);

            title.Text = data.Title;

            if (data.User == null || data.User.Username == null || data.User.Username == string.Empty)
            {
                this.Height = this.Height - 15;
                sp.Children.Remove(upName);
                return;
            }
            upName.Text = "UP: " + data.User.Username;
        }
Exemple #8
0
        private async void GetBangumiVideoData()
        {
            if (_SeleCContent.Bangumi.BangumiId != null)
            {
                var url = AcFunAPI.GetBangumiContentUrl(_SeleCContent.Bangumi.BangumiId);
                BangumiDetailData bdd = new BangumiDetailData();
                await bdd.GetData(url);

                if (bdd.ListOfACContent == null)
                {
                    MSGSHOW("资源获取失败");
                    return;
                }
                _SeleCContent = bdd.ListOfACContent[0];
                _selecVideo   = _SeleCContent.DetailVideos[0];
                GetVideoSourceData();
                AddVideoInfoDetail();
            }
        }
Exemple #9
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _SeleCContent = e.Parameter as AcContent;
            if (_SeleCContent != null)
            {
                TestFunc();
            }
            else
            {
                _localVideoData = e.Parameter as DownloadData;
                isLocalFile     = true;
                PlayLocalVideo();
            }

            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                StatusBar statusBar = StatusBar.GetForCurrentView();
                statusBar.HideAsync();
            }
            //InitFunc();
        }
Exemple #10
0
 private void NavigationToDetailsPage(AcContent ac)
 {
     this.Frame.Navigate(typeof(DetailsPage), ac);
 }