当前位置: 首页>>代码示例>>C#>>正文


C# Category.IsSinglePageCategoriesState方法代码示例

本文整理汇总了C#中Category.IsSinglePageCategoriesState方法的典型用法代码示例。如果您正苦于以下问题:C# Category.IsSinglePageCategoriesState方法的具体用法?C# Category.IsSinglePageCategoriesState怎么用?C# Category.IsSinglePageCategoriesState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Category的用法示例。


在下文中一共展示了Category.IsSinglePageCategoriesState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetVideos

 public override List<VideoInfo> GetVideos(Category category)
 {
     if (category.IsPlayNow())
     {
         List<VideoInfo> videos = new List<VideoInfo>();
         if (category.IsSinglePageCategoriesState())
         {
             foreach (NetflixData d in GetSinglePageNetflixData(category, true))
             {
                 videos.Add(new VideoInfo()
                 {
                     Title = d.Title,
                     VideoUrl = string.Format(playerUrl, d.Id) + "&trkid=" + d.TrackId,
                     Thumb = d.Cover,
                     Description = d.Description,
                     Other = new SerializableDictionary<string, string>() { { "TrackId", d.TrackId }, { "VideoId", d.Id } }
                 });
             }
         }
         return videos;
     }
     return new List<VideoInfo>() { new VideoInfo() { Description = category.Description, VideoUrl = string.Format(playerUrl, (category as RssLink).Url), Title = category.Name, Thumb = category.Thumb } };
 }
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:23,代码来源:NetfilxWebUtil.cs

示例2: DiscoverSubCategories


//.........这里部分代码省略.........
                        Name = m.Groups["name"].Value,
                        Url = m.Groups["url"].Value,
                        Thumb = m.Groups["thumb"].Value,
                        ParentCategory = characters,
                        HasSubCategories = true
                    };
                    character.SetState(NetflixUtils.SinglePageCategoriesState);
                    characters.SubCategories.Add(character);
                }
                characters.SubCategoriesDiscovered = characters.SubCategories.Count > 0;
                parentCategory.SubCategories.Add(characters);

                foreach (HtmlNode a in doc.DocumentNode.SelectNodes("//a[contains(@href, 'netflix.com/KidsAltGenre')]"))
                {
                    string url = a.GetAttributeValue("href", "");
                    if (!parentCategory.SubCategories.Any(c => (c as RssLink).Url == url))
                    {
                        RssLink category = new RssLink()
                        {
                            Name = a.InnerText.Trim(),
                            Url = a.GetAttributeValue("href", ""),
                            HasSubCategories = true,
                            ParentCategory = parentCategory
                        };
                        category.SetState(NetflixUtils.SinglePageCategoriesState);
                        parentCategory.SubCategories.Add(category);
                    }
                }

            }
            #endregion

            #region SinglePageCategories
            else if (parentCategory.IsSinglePageCategoriesState())
            {
                foreach (NetflixData d in GetSinglePageNetflixData(parentCategory, enableAddRemoveMylist))
                {
                    RssLink cat = new RssLink()
                    {
                        Name = d.Title,
                        Url = d.Id,
                        Thumb = d.Cover,
                        ParentCategory = parentCategory,
                        HasSubCategories = !(parentCategory.ParentCategory != null && parentCategory.ParentCategory.Name == "Characters"),
                        Description = d.Description
                    };
                    cat.SetState(NetflixUtils.TitleState);
                    if (!string.IsNullOrEmpty(d.TrackId))
                        cat.SetTrackId(d.TrackId);
                    parentCategory.SubCategories.Add(cat);
                }
            }
            #endregion

            #region MultiplePageCategories
            else if (parentCategory.IsMultiplePageCategoriesState()) //This is browse categories
            {
                string url = (parentCategory as RssLink).Url;
                string data = MyGetWebData(url);
                SetShaktiApiAndBuildId(data);
                Uri uri = new Uri(url);
                string agid = HttpUtility.ParseQueryString(uri.Query).Get("agid");
                if (!string.IsNullOrEmpty(ShaktiApi) && !string.IsNullOrEmpty(BuildId) && !string.IsNullOrEmpty(agid))
                {
                    data = MyGetWebData(string.Format(genreUrl, ShaktiApi, BuildId, agid, 0, 50, BrowseSort));
                    JObject json = (JObject)JsonConvert.DeserializeObject(data);
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:67,代码来源:NetfilxWebUtil.cs


注:本文中的Category.IsSinglePageCategoriesState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。