public object VisitRule(XshdRule rule)
 {
     return(new HighlightingRule {
         Color = GetColor(rule, rule.ColorReference),
         Regex = CreateRegex(rule, rule.Regex, rule.RegexType)
     });
 }
        object IXshdVisitor.VisitRule(XshdRule rule)
        {
            writer.WriteStartElement("Rule", Namespace);
            WriteColorReference(rule.ColorReference);

            writer.WriteString(rule.Regex);

            writer.WriteEndElement();
            return(null);
        }
Beispiel #3
0
        static XshdRule ParseRule(XmlReader reader)
        {
            XshdRule rule = new XshdRule();

            SetPosition(rule, reader);
            rule.ColorReference = ParseColorReference(reader);
            if (!reader.IsEmptyElement)
            {
                reader.Read();
                if (reader.NodeType == XmlNodeType.Text)
                {
                    rule.Regex     = reader.ReadContentAsString();
                    rule.RegexType = XshdRegexType.IgnorePatternWhitespace;
                }
            }
            return(rule);
        }
 public object VisitRule(XshdRule rule)
 {
     return(rule.ColorReference.AcceptVisitor(this));
 }