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


C# Category.GetOtherAsString方法代码示例

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


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

示例1: GetVideos

 public override List<VideoInfo> GetVideos(Category category)
 {
     HasNextPage = false;
     List<VideoInfo> videos;
     if (category.Other is string && category.GetOtherAsString() == episodeVideosState)
     {
         currentVideoUrl = "";
         currentVideoOffset = 0;
         videos = GetVideos((category as RssLink).Url);
     }
     else
     {
         currentVideoUrl = (category as RssLink).Url;
         currentVideoOffset = 0;
         videos = GetVideos(string.Format(currentVideoUrl, currentVideoOffset));
         HasNextPage = videos.Count > 19;
     }
     return videos;
 }
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:19,代码来源:URPlayUtil.cs

示例2: GetVideos

 public override List<VideoInfo> GetVideos(Category category)
 {
     HasNextPage = false;
     if (category is SvtCategory)
     {
         return (category as SvtCategory).Videos;
     }
     else if (category.GetOtherAsString() != "isChannels")
     {
         currentVideosUrl = (category as RssLink).Url;
         currentVideosPage = 1;
         bool hasNext = false;
         List<VideoInfo> videos = GetVideos(currentVideosUrl, currentVideosPage, out hasNext);
         HasNextPage = hasNext;
         return videos;
     }
     else
     {
         return GetChannelVideos();
     }
 }
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:21,代码来源:SVTPlayUtil.cs

示例3: GetVideos

 public override List<VideoInfo> GetVideos(Category category)
 {
     if (category.Other is string && category.GetOtherAsString() == "forum")
         throw new OnlineVideosException("Visit http://tinyurl.com/olv-hbonordic");
     List<VideoInfo> videos = new List<VideoInfo>();
     string url = ConstructUrl((category as RssLink).Url);
     XmlDocument xDoc = HboWebCache.Instance.GetWebData<XmlDocument>(url, referer: BaseUrl, headers: ConstructNameValueCollection(), cache: false);
     foreach (XmlElement item in xDoc.SelectNodes("//item"))
     {
         //I don't know how to select with namespace...
         XmlNodeList medias = item.GetElementsByTagName("media:group")[0].ChildNodes;
         XmlElement thumb = null;
         foreach (XmlElement elt in medias)
         {
             if (elt.Name == "media:thumbnail")
             {
                 thumb = elt;
                 break;
             }
         }
         string title = item.GetElementsByTagName("title")[0].InnerText;
         XmlNodeList episodeNodes = item.GetElementsByTagName("clearleap:episodeInSeason");
         if (episodeNodes != null && episodeNodes.Count > 0)
         {
             string episode = episodeNodes[0].InnerText;
             string season = item.GetElementsByTagName("clearleap:season")[0].InnerText;
             string series = item.GetElementsByTagName("clearleap:series")[0].InnerText;
             int s = 0;
             int e = 0;
             int.TryParse(episode, out e);
             int.TryParse(season, out s);
             title = series + " - " + s + "x" + (e > 9 ? e.ToString() : "0" + e.ToString()) + " " + title;
         }
         bool isSaved = false;
         XmlNodeList savedAsset = item.GetElementsByTagName("clearleap:savedAsset");
         if (savedAsset != null && savedAsset.Count > 0)
         {
             bool.TryParse(savedAsset[0].InnerText, out isSaved);
         }
         string other = @"{{""saved"":{0}, ""guid"":""{1}""}}";
         XmlNodeList desc = item.GetElementsByTagName("description");
         videos.Add(new VideoInfo()
         {
             Title = title,
             Description = (desc != null && desc.Count > 0) ? desc[0].InnerText : string.Empty,
             Thumb = (thumb != null) ? thumb.Attributes["url"].Value : "",
             Other = string.Format(other, isSaved.ToString().ToLower(), item.GetElementsByTagName("guid")[0].InnerText)
         });
     }
     return videos;
 }
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:51,代码来源:HboNordicWebUtil.cs

示例4: GetVideos

 public override List<VideoInfo> GetVideos(Category category)
 {
     HasNextPage = false;
     List<VideoInfo> videos;
     if (cApiContentTypeTvSeries == category.GetOtherAsString())
     {
         CurrentSeriesVideoUrl = (category as RssLink).Url;
         CurrentSeriesVideoOffset = 0;
         CurrentSeriesCategoryName = category.Name;
         videos = GetSeriesVideos();
     }
     else if (cApiContentTypeTvLive == category.GetOtherAsString())
     {
         videos = GetLiveVideos();
     }
     else if (cArchiveCategory == category.GetOtherAsString())
     {
         videos = GetArchiveVideos(category);
     }
     else
     {
         videos = new List<VideoInfo>();
         string url = string.Format(cUrlProgramFormat, BaseUrl, (category as RssLink).Url, AppInfo.AppId, AppInfo.AppKey);
         JObject json = GetWebData<JObject>(url);
         JToken data = json["data"];
         VideoInfo video = GetVideoInfoFromJsonData(data, false);
         if (video != null)
         {
             videos.Add(video);
         }
     }
     return videos;
 }
开发者ID:JSurf,项目名称:mp-onlinevideos2,代码行数:33,代码来源:YleUtil.cs

示例5: DiscoverSubCategories

 public override int DiscoverSubCategories(Category parentCategory)
 {
     string other = parentCategory.GetOtherAsString();
     string url = baseUrl + (parentCategory as RssLink).Url;
     if (string.IsNullOrEmpty(other))
     {
         parentCategory.SubCategories = DiscoverSubCategoriesFromListing(url);
     }
     else
     {
         string data = GetWebData(url);
         Regex r = new Regex(@"showRowText"">(?<n>.*?)</div>.*?<a href=""(?<u>[^""]*?-" + other + @")""", RegexOptions.Singleline);
         parentCategory.SubCategories = new List<Category>();
         foreach (Match m in r.Matches(data))
         {
             RssLink cat = new RssLink()
             {
                 Name = m.Groups["n"].Value,
                 Url = m.Groups["u"].Value,
                 HasSubCategories = other == "shows"
             };
             parentCategory.SubCategories.Add(cat);
         }
     }
     parentCategory.SubCategories.ForEach(c => c.ParentCategory = parentCategory);
     parentCategory.SubCategoriesDiscovered = parentCategory.SubCategories.Count() > 0;
     return parentCategory.SubCategories.Count();
 }
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:28,代码来源:LosMoviesUtil.cs


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