コード例 #1
0
        private async Task Setup()
        {
            await analyzeService.CacheAllTalk();

            foreach (var userName in analyzeService.AllTalkDictionary.Keys)
            {
                ListBoxUser.Items.Add(userName);
            }

            var totalWord = new List <Word>();

            foreach (var item in analyzeService.AllTalkDictionary)
            {
                totalWord.AddRange(item.Value);
            }

            var enumerable = totalWord.GroupBy(w => w.Base).Select(x => new
            {
                RealName = x.Key,
                Count    = x.Count()
            })
                             .Where(x => x.Count > 1)
                             .OrderByDescending(x => x.Count);


            foreach (var item in enumerable)
            {
                WordViewModels.Add(new WordViewModel {
                    Base = item.RealName, Count = item.Count
                });
            }

            ListBoxWord.ItemsSource = WordViewModels;
        }
コード例 #2
0
 public async Task CacheAllTalk()
 {
     var service = new AnalyzeService();
     await service.CacheAllTalk();
 }