Example #1
0
        public static WordsListStats BuildFrom(WordList wordList)
        {
            List <WordInfo>        words        = wordList.GetAllWords().ToList();
            List <TranslationInfo> translations = wordList.GetAllTranslations().ToList();

            WordsListStats stats = new WordsListStats();

            stats.WordCount         = words.Count;
            stats.StudiedWordCount  = words.Count(w => w.IsStudied);
            stats.RepeatedWordCount = words.Count(w => w.IsRepeated);
            stats.LearnedWordCount  = words.Count(w => w.IsLearned);
            stats.VerifiedWordCount = words.Count(w => w.IsVerified);

            stats.TranslationCount         = translations.Count;
            stats.StudiedTranslationCount  = translations.Count(w => w.IsStudied);
            stats.RepeatedTranslationCount = translations.Count(w => w.IsRepeated);
            stats.LearnedTranslationCount  = translations.Count(w => w.IsLearned);
            stats.VerifiedTranslationCount = translations.Count(w => w.IsVerified);

            return(stats);
        }
Example #2
0
        public static WordsListStats BuildFrom(WordList wordList)
        {
            List<WordInfo> words = wordList.GetAllWords().ToList();
            List<TranslationInfo> translations = wordList.GetAllTranslations().ToList();

            WordsListStats stats = new WordsListStats();

            stats.WordCount = words.Count;
            stats.StudiedWordCount = words.Count(w => w.IsStudied);
            stats.RepeatedWordCount = words.Count(w => w.IsRepeated);
            stats.LearnedWordCount = words.Count(w => w.IsLearned);
            stats.VerifiedWordCount = words.Count(w => w.IsVerified);

            stats.TranslationCount = translations.Count;
            stats.StudiedTranslationCount = translations.Count(w => w.IsStudied);
            stats.RepeatedTranslationCount = translations.Count(w => w.IsRepeated);
            stats.LearnedTranslationCount = translations.Count(w => w.IsLearned);
            stats.VerifiedTranslationCount = translations.Count(w => w.IsVerified);
            
            return stats;
        }
Example #3
0
 private void UpdateStats()
 {
     Stats = WordsListStats.BuildFrom(this);
 }
Example #4
0
 private void UpdateStats()
 {
     Stats = WordsListStats.BuildFrom(this);
 }