public HighlightWordsRule(XElement rule)
        {
            Words   = new List <string>();
            Options = new RuleOptions(rule);

            var wordsStr = rule.Element("Words")?.Value;

            if (wordsStr == null)
            {
                return;
            }
            var words = Regex.Split(wordsStr, "\\s+");

            foreach (var word in words)
            {
                if (!string.IsNullOrWhiteSpace(word))
                {
                    Words.Add(word.Trim());
                }
            }
        }
Esempio n. 2
0
 public HighlightLineRule(XElement rule)
 {
     LineStart = rule.Element("LineStart")?.Value.Trim();
     Options   = new RuleOptions(rule);
 }
Esempio n. 3
0
 public AdvancedHighlightRule(XElement rule)
 {
     Expression = rule.Element("Expression")?.Value.Trim();
     Options    = new RuleOptions(rule);
 }