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); }
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; }
private void UpdateStats() { Stats = WordsListStats.BuildFrom(this); }