Beispiel #1
0
 public async Task <NiconicoVideoRss> GetCategoryRanking(RankingCategory category, RankingTarget target, RankingTimeSpan timeSpan)
 {
     return(await ContextActionAsync(async context =>
     {
         return await NiconicoRanking.GetRankingData(target, timeSpan, category);
     }));
 }
Beispiel #2
0
        RankingCategoryListPageListItem CreateRankingCategryListItem(RankingCategory category)
        {
            var categoryInfo       = RankingCategoryInfo.CreateFromRankingCategory(category);
            var isFavoriteCategory = RankingSettings.HighPriorityCategory.Contains(categoryInfo);

            return(new RankingCategoryListPageListItem(category, isFavoriteCategory, OnRankingCategorySelected));
        }
Beispiel #3
0
 public async Task <NiconicoVideoRss> GetCategoryRanking(RankingCategory category, RankingTarget target, RankingTimeSpan timeSpan)
 {
     return(await ConnectionRetryUtil.TaskWithRetry(async() =>
     {
         return await NiconicoRanking.GetRankingData(target, timeSpan, category);
     }));
 }
Beispiel #4
0
 public CategoryRankingLoadingSource(HohoemaApp app, PageManager pageManager, RankingCategory category, RankingTarget target, RankingTimeSpan timeSpan)
     : base(app, $"Ranking:{category.ToCultulizedText()}")
 {
     _HohoemaApp  = app;
     _PageManager = pageManager;
     _Category    = category;
     _Target      = target;
     _TimeSpan    = timeSpan;
 }
 public CategoryRankingLoadingSource(HohoemaApp app, PageManager pageManager, RankingCategory category, RankingTarget target, RankingTimeSpan timeSpan)
     : base()
 {
     _HohoemaApp  = app;
     _PageManager = pageManager;
     Category     = category;
     Target       = target;
     TimeSpan     = timeSpan;
 }
Beispiel #6
0
        public static string ToCultulizedText(this RankingCategory category)
        {
            switch (CultureInfo.CurrentCulture.TwoLetterISOLanguageName)
            {
            case "ja":
                return(GetJaText(category));

            case "en":
            default:
                var s     = category.ToString();
                var first = s.Substring(0, 1);
                return(first.ToUpper() + s.Substring(1, s.Length - 1));
            }
        }
Beispiel #7
0
        public void AddDislikeCategory(RankingCategory category)
        {
            var allPrio = new[] { HighPriorityCategory, MiddlePriorityCategory, LowPriorityCategory };

            foreach (var prio in allPrio)
            {
                var target = prio.FirstOrDefault(x => x.Category == category);
                if (target != null)
                {
                    prio.Remove(target);
                }
            }

            LowPriorityCategory.Add(new RankingCategoryInfo(category));
        }
Beispiel #8
0
 public CategoryRankingLoadingSource(
     RankingCategory category,
     RankingTarget target,
     RankingTimeSpan timeSpan,
     NicoVideoProvider nicoVideoProvider,
     NGSettings ngSettings
     )
     : base()
 {
     Category          = category;
     Target            = target;
     TimeSpan          = timeSpan;
     NicoVideoProvider = nicoVideoProvider;
     NgSettings        = ngSettings;
 }
Beispiel #9
0
        public bool AddDislikeCategory(RankingCategory category)
        {
            var target = MiddlePriorityCategory.FirstOrDefault(x => x.Category == category);

            if (target != null)
            {
                MiddlePriorityCategory.Remove(target);
                LowPriorityCategory.Add(target);
                return(true);
            }
            else if ((target = HighPriorityCategory.FirstOrDefault(x => x.Category == category)) != null)
            {
                HighPriorityCategory.Remove(target);
                LowPriorityCategory.Add(target);
                return(true);
            }

            return(false);
        }
Beispiel #10
0
 internal void OnRankingCategorySelected(RankingCategory info)
 {
     PageManager.OpenPage(HohoemaPageType.RankingCategory, info.ToString());
 }
Beispiel #11
0
        private static string GetJaText(RankingCategory category)
        {
            switch (category)
            {
            case RankingCategory.all:
                return("カテゴリ合算");

            case RankingCategory.g_ent2:
                return("エンタメ・音楽");

            case RankingCategory.ent:
                return("エンターテイメント");

            case RankingCategory.music:
                return("音楽");

            case RankingCategory.sing:
                return("歌ってみた");

            case RankingCategory.dance:
                return("踊ってみた");

            case RankingCategory.play:
                return("演奏してみた");

            case RankingCategory.vocaloid:
                return("VOCALOID");

            case RankingCategory.nicoindies:
                return("ニコニコインディーズ");

            case RankingCategory.g_life2:
                return("生活・一般・スポ");

            case RankingCategory.animal:
                return("動物");

            case RankingCategory.cooking:
                return("料理");

            case RankingCategory.nature:
                return("自然");

            case RankingCategory.travel:
                return("旅行");

            case RankingCategory.sport:
                return("スポーツ");

            case RankingCategory.lecture:
                return("ニコニコ動画講座");

            case RankingCategory.drive:
                return("車載動画");

            case RankingCategory.history:
                return("歴史");

            case RankingCategory.g_politics:
                return("政治");

            case RankingCategory.g_tech:
                return("科学・技術");

            case RankingCategory.science:
                return("科学");

            case RankingCategory.tech:
                return("ニコニコ技術部");

            case RankingCategory.handcraft:
                return("ニコニコ手芸部");

            case RankingCategory.make:
                return("作ってみた");

            case RankingCategory.g_culture2:
                return("アニメ・ゲーム・絵");

            case RankingCategory.anime:
                return("アニメ");

            case RankingCategory.game:
                return("ゲーム");

            case RankingCategory.jikkyo:
                return("実況プレイ動画");

            case RankingCategory.toho:
                return("東方");

            case RankingCategory.imas:
                return("アイドルマスター");

            case RankingCategory.radio:
                return("ラジオ");

            case RankingCategory.draw:
                return("描いてみた");

            case RankingCategory.g_other:
                return("その他(合算)");

            case RankingCategory.are:
                return("例のアレ");

            case RankingCategory.diary:
                return("日記");

            case RankingCategory.other:
                return("その他");

            default:
                return("?");
            }
        }
 public static string ToCultulizedText(this RankingCategory category)
 {
     return(_resourceLoader.GetString(category.ToString()));
 }
Beispiel #13
0
 public RankingCategoryInfo(RankingCategory category)
 {
     Category     = category;
     Parameter    = category.ToString();
     DisplayLabel = category.ToCulturelizeString();
 }
Beispiel #14
0
 public static RankingCategoryInfo CreateFromRankingCategory(RankingCategory cat)
 {
     return(new RankingCategoryInfo(cat));
 }
Beispiel #15
0
        public bool IsDislikeRankingCategory(RankingCategory category)
        {
            var categoryString = category.ToString();

            return(LowPriorityCategory.Any(x => x.Parameter == categoryString));
        }