public void AddWord(string content, string style, HighlightWord.WordMatchType matchType) { highlightWords.Add(new HighlightWord(content) { Style = style, MatchType = matchType, }); }
public void HighlightStaticsticIncrease(StatisticsDataSet.HighlightStatisticsRow runStatistics, HighlightWord word) { StatisticsDataSet.WordStatisticsRow wordRow = statisticsDataSet.WordStatistics.FirstOrDefault(row => row.Word == word.Content && row.RunId == runStatistics.RunId); if (wordRow == null) { wordRow = statisticsDataSet.WordStatistics.AddWordStatisticsRow (word.Content , word.BackgroundColor.ToArgb() , runStatistics , 0); } runStatistics.TotalMatchedCount++; wordRow.MatchedCount++; }
public bool Match(string word, out HighlightWord hlWord) { foreach (HighlightWord hw in highlightWords) { if (hw.Matches(word)) { hlWord = hw; return true; } } hlWord = null; return false; }