public MessagesContainer(List <Message> messages) { this.Messages = messages; if (messages.Count == 0) { SortedWords = new List <Word>(); return; } var sorter = new SorterWordsGroupListMaker(this.Messages); var groupedSortedWords = sorter.SortedWordsByFrequents; var words = groupedSortedWords.Select(x => new Word(x.Key, x.Count())); SortedWords = words.ToList(); }
private void OpenWordsSettings() { (int, int)? newValues; try { newValues = GetValues(); } catch { return; } if (null == newValues) { SorterWordsGroupListMaker.SetDefaultValues(); } else { SetValues(newValues.Value); } TryToSaveToFile(); this.ChangedValues = true; }