Exemplo n.º 1
0
 public void AddWord(string content, string style, HighlightWord.WordMatchType matchType)
 {
     highlightWords.Add(new HighlightWord(content)
                        {
                                Style = style,
                                MatchType = matchType,
                        });
 }
Exemplo n.º 2
0
 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++;
 }
Exemplo n.º 3
0
        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;
        }